SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Objects not recognised even after refresh
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

token
Posting Yak Master

United Kingdom
133 Posts

Posted - 11/04/2012 :  09:51:59  Show Profile  Reply with Quote
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

India
52323 Posts

Posted - 11/04/2012 :  11:44:52  Show Profile  Reply with Quote
this works same for me too. Intellisense will not pick up new objects created until I close and restart SSMS

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

sunitabeck
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 11/04/2012 :  11:54:31  Show Profile  Reply with Quote
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;
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52323 Posts

Posted - 11/04/2012 :  12:19:46  Show Profile  Reply with Quote
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;



Sunita
Its not about object being created but its about Intellisense not picking it up

The catalog views,objects explorer etc will still show it whereas Intellisense wont pick it up until SSMS restart

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

token
Posting Yak Master

United Kingdom
133 Posts

Posted - 11/05/2012 :  05:54:16  Show Profile  Reply with Quote
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
Go to Top of Page

Bustaz Kool
Flowing Fount of Yak Knowledge

USA
1754 Posts

Posted - 11/05/2012 :  12:14:00  Show Profile  Reply with Quote
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
Go to Top of Page

Bustaz Kool
Flowing Fount of Yak Knowledge

USA
1754 Posts

Posted - 11/05/2012 :  17:05:23  Show Profile  Reply with Quote
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
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52323 Posts

Posted - 11/05/2012 :  21:06:58  Show Profile  Reply with Quote
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 MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000