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?
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.
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.
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.
#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.
"##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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With