Invalid Objects when using Temp Tables

Provides intelligent code completion for SQL Server editors.

Moderators: David Atkinson, Anu Deshpande, Luke Jefferson, Paul Stephenson

Invalid Objects when using Temp Tables

Postby sdyckes » Mon Oct 04, 2010 2:50 pm

When using temp tables, the red squiggly underlines appear under the Temp table and all columns referencing the temp table. The message that appears when you hover on the object is "invalid Column Name" or "invalid Object Name".
If I use the format SQL, it will then validate and clear the "errors", and all the angry red squiggles disappear.

It does recognize the temp table name and its columns in the intellisense portion as I am writing the script. It does not cause any errors or problems that I am aware of.
sdyckes
 
Posts: 3
Joined: Fri Oct 01, 2010 9:26 pm
Location: Charlotte NC

Postby Paul Stephenson » Mon Oct 04, 2010 3:44 pm

Hello sdyckes,

I've not been able to reproduce your problem -- would you be able to post a sample script?

It would also be useful to know which versions of Windows, SSMS and SQL Prompt you are using.

Thanks for your feedback,
Paul Stephenson
SQL Prompt Project Manager
Red Gate Software
Paul Stephenson
 
Posts: 109
Joined: Fri Jul 23, 2010 9:22 am
Location: Cambridge, UK

Postby sdyckes » Mon Oct 04, 2010 5:58 pm

No problem, let me know if you need any more info.

I was running SQL Prompt 4, I did an uninstall before installing the 5. I do not recall if I rebooted or not. :shock:

I can reproduce it with this script:

SELECT 'john' AS Fname, 'Jingle' AS Lname INTO #name
UNION
SELECT 'phil' AS Fname, 'Hart' AS Lname

SELECT * FROM #name AS N WHERE N.Lname = 'Hart'

--DROP TABLE #name

I noticed that the validation errors(red squibbles) return even after formatting, it was only temporary.

My local machine:
WinXP Pro Version 2002 SP3

Prompt:
5.0.0.365

SSMS:
10.0.2531.0

Connecting to SQL2008:
Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64) Mar 29 2009 10:11:52 Copyright (c) 1988-2008 Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 5.2 <X64> (Build 3790: Service Pack 2)

Here is the system info from SSMS:
Microsoft SQL Server Management Studio 10.0.2531.0
Microsoft Analysis Services Client Tools 10.0.1600.22
Microsoft Data Access Components (MDAC) 3.85.1132
Microsoft MSXML 2.6 3.0 5.0 6.0
Microsoft Internet Explorer 8.0.6001.18702
Microsoft .NET Framework 2.0.50727.3607
Operating System 5.1.2600

Thanks,
Stephen
sdyckes
 
Posts: 3
Joined: Fri Oct 01, 2010 9:26 pm
Location: Charlotte NC

Postby Paul Stephenson » Thu Oct 07, 2010 9:06 am

Hi Stephen,

Thanks for the details. I've managed to see your issue with a similar setup.

I'm afraid the red squigglies you see are put there by SSMS 2008's own syntax checker (when connecting to a SQL Server 2008 DB), not by SQL Prompt. When I uninstalled SQL Prompt I got the same behaviour.

If you want to turn off Microsoft's red squigglies altogether then go to Tools > Options > Text Editor > Transact-SQL > Intellisense and uncheck Underline errors.

Regards,
Paul Stephenson
SQL Prompt Project Manager
Red Gate Software
Paul Stephenson
 
Posts: 109
Joined: Fri Jul 23, 2010 9:22 am
Location: Cambridge, UK

Postby sdyckes » Thu Oct 07, 2010 1:28 pm

Thanks for following up.
That would explain the inconsistent action I experience. I prefer to use SQL Prompt, so I will just turn off the SSMS. I did not think to check the SSMS intellisense, as I had not seen that particular action before I had installed SQL Prompt 5, so I made a bad assumption.
Thanks again,

Stephen
sdyckes
 
Posts: 3
Joined: Fri Oct 01, 2010 9:26 pm
Location: Charlotte NC


Return to SQL Prompt 5 EAP

Who is online

Users browsing this forum: Bing [Bot] and 1 guest