sql - How to calm the IDE about not declared temporary table? -


when design temporary table follows, manager growls @ name #temp , marks red highlight.

drop table #temp select * #temp donkeys 

when hover on highlight, reason - expected - name isn't recognized.

cannot drop table '#temp', because not exist or not have permissions.

now, i'm not sql developer - come c# , i'm spoiled intellisense, resharper , not, dislike when highlighted (even although works). installed management studio 11.x intellisense working , want money worth, if possible.

the question - can highlight (purely visually, because functionality - pointed out earlier - it's supposed to)?

please note question not why happens or if it's problem. understand why , i'm declaring problem (yeah, admit it's not biggest issue it's big enough me invest time asking). also, i'm human (i.e. lazy-ish) simple solution do. :)

it can achieved combination ctrlshiftr.

you receiving issue because #temp not exist yet. either need check it's existence so:

if object_id('tempdb..#temp') not null begin drop table #temp end select * #temp donkeys 

or can drop table after you've used it:

select * #temp donkeys drop table #temp 

Comments