Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Red error lines on SQL temp tables

Tags:

sql

ssms

When I create temp tables in SQL Server Management Studio and then I use them to view some records the temp tables have an error red line. However, they work just fine when I execute a query. Does anyone know how to remove these red lines?

like image 417
lowfideliter Avatar asked Jun 17 '15 16:06

lowfideliter


People also ask

What does the red line in SQL mean?

This question already has an answer here:A newly created table or procedure will always have the red squiggly underline until the SQL Server Management Studio is restarted.

How do I get rid of the red squiggly lines in SQL?

The solution is, SQL Server Management Studio IntelliSence Local Cache: We should refresh IntelliSense Local Cache so that all newly created objects added in the cache and red underline will disappear. You can refresh the IntelliSense Local Cache from the edit menu of SSMS.

What does line mean in SQL error?

Line number. A number within the batch or stored procedure that contains the statement that generated the message. Line number can also be within the text of the stored procedure that is being executed. Line is the line number of the code depending the state of the execution process. A single string would be line 1.

What is #table and ## table in SQL?

#1519212. #temp tables are available ONLY to the session that created it and are dropped when the session is closed. ##temp tables (global) are available to ALL sessions, but are still dropped when the session that created it is closed and all other references to them are closed.

What is ## temp table?

"##tempTable" denotes Global Temporary Tables. It starts with the single hash value "##" as the prefix of the table name and its name is always unique. There is no random number appended to the name. Global Temporary Tables are visible to all connections of SQL Server.


1 Answers

You need to rebuild your IntelliSense cache.

The SSMS keyboard shortcut for this is CTRL+SHIFT+R.

Alternatively, you can go to Edit → IntelliSense → Refresh Local Cache.

like image 176
Siyual Avatar answered Sep 29 '22 03:09

Siyual