Author |
Topic |
token
Posting Yak Master
133 Posts |
Posted - 2012-11-04 : 09:51:59
|
This has been a longtime bug bear for me and I'm sure there's got to be a simple way to fix it.When I create a new table or SP and refresh the database, I can see the object just fine in the object explorer. But when I'm typing a query using the newly created object the query window will say the object doesn't exist! It only seems to recognise it when I close down Management Studio and restart it.I have tried refreshing the Intellisense cache as well but it doesn't work. Whats up with it? |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-11-04 : 11:44:52
|
this works same for me too. Intellisense will not pick up new objects created until I close and restart SSMS------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-11-04 : 11:54:31
|
I have not seen this behavior. After you create a new table, if you run the following command, do you see the table?SELECT * FROM INFORMATION_SCHEMA.[TABLES] c WHERE c.TABLE_NAME = 'YourNewTableName' If you do see it, prefix the table_catalog name and table_schema name and try to do run a query. E.g.:SELECT * FROM MyDB.dbo.YourNewTableName; |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-11-04 : 12:19:46
|
quote: Originally posted by sunitabeck I have not seen this behavior. After you create a new table, if you run the following command, do you see the table?SELECT * FROM INFORMATION_SCHEMA.[TABLES] c WHERE c.TABLE_NAME = 'YourNewTableName' If you do see it, prefix the table_catalog name and table_schema name and try to do run a query. E.g.:SELECT * FROM MyDB.dbo.YourNewTableName;
SunitaIts not about object being created but its about Intellisense not picking it upThe catalog views,objects explorer etc will still show it whereas Intellisense wont pick it up until SSMS restart------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
token
Posting Yak Master
133 Posts |
Posted - 2012-11-05 : 05:54:16
|
Yes thats correct, the Query window will not pick up the newly created object. It underlines it in a squiggly red line and says object does not exist but the actual query will run fine because the object does exist! Its really annoying and has been like this since I can remember... why nobody has fixed this is crazy |
|
|
Bustaz Kool
Master Smack Fu Yak Hacker
1834 Posts |
Posted - 2012-11-05 : 12:14:00
|
From SSMS you can refresh the Intellisense cache via Edit->IntelliSense->Refresh Local Cache (or Cntl-Shift-R). It's still inconvenient but perhaps less so.=================================================We are far more concerned about the desecration of the flag than we are about the desecration of our land. -Wendell Berry |
|
|
Bustaz Kool
Master Smack Fu Yak Hacker
1834 Posts |
Posted - 2012-11-05 : 17:05:23
|
From SSMS you can refresh the Intellisense cache via Edit->IntelliSense->Refresh Local Cache (or Cntl-Shift-R). It's still inconvenient but perhaps less so.=================================================We are far more concerned about the desecration of the flag than we are about the desecration of our land. -Wendell Berry |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-11-05 : 21:06:58
|
quote: Originally posted by Bustaz Kool From SSMS you can refresh the Intellisense cache via Edit->IntelliSense->Refresh Local Cache (or Cntl-Shift-R). It's still inconvenient but perhaps less so.=================================================We are far more concerned about the desecration of the flag than we are about the desecration of our land. -Wendell Berry
Dont work sometimes for me. So only reliable way I've found is to restart the SSMS------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|