I'm using SSMS 2008 R2 and honestly, this is so irritating that IntelliSense doesn't work on local temporary table.
Here is a simple example:
if object_id('tempdb..#MyLocalTmpTable') is not null drop table MyLocalTmpTable create table dbo.#MyLocalTmpTable ( CustumerId uniqueidentifier, Name varchar(250) null, Surname varchar(250) null, Email varchar(500) null ) delete dbo.#MyLocalTmpTable
As you can see in the picture below, #MyLocalTmpTable isn’t recognized and the auto-completion won’t work.
But what is even less understandable is that this is working for temporary table????
declare @MyTmpTable as table ( CustumerId uniqueidentifier, Name varchar(250) null, Surname varchar(250) null, Email varchar(500) null ) delete @MyTmpTable
Here I’ve got my list member working.
Anyone knows how to set SSMS 2008 in order to detect local tmp tables?
PS: Please don’t suggest to refresh local cache, I’ve already done it several dozens times and it doesn’t work.