Saturday, December 19, 2009

How to get Sql server 2008 intellisense working for schema changes

The new feature "intellisense" added in sql server 2008 is making my life easier. And I am enjoying this feature a lot. But I noticed many times that when we make any changes to DB schema like creating / modifying database objects (tables, sprocs, ...) we don't notice the schema changes in intellisense in the same session. This made me too bad and many times I cursed Microsoft for this inclomplete feature. But after making some research on this, I have found the solution to get intellisense for new schema changes in current session.

Actually what happens when you connect to sql server 2008 using sql server management studio is, it queries for the current database schema and saves it somewhere. And It uses this schema information for showing the intellisense when the user is writing queries. But when we create/update the sql objects (sprocs, tables, views, ...) these won't be updated and the intellisense is pulled from old schema. That's why we don't notice the schema changes in intellisense unless we explicitly refresh the cache. In order to get new chema changes we must clear the intellisense cache.

To clear the intellisense cache we need to click Edit -> Intellisense -> RefreshLocalCache in sql server 2008 management studio as shown in below screen.


Shout it
kick it on DotNetKicks.com

8 comments:

Kiran said...

Nice tip. that helps.

Modern Sport Watches said...

The Mini Modern Hookah has a beautiful shaft with a small pumpkin shaped. The vase of the this beautiful hookah is made out of glass. The vase is transparent; allowing you to see through. This opportunity makes your special moment more joyful.

http://www.maharajahookah.com/mini-hookah/cat_3.html
http://www.maharajahookah.com/mini-hookah/10-2-hose-mini-red-fuzz-hookah-shisha/prod_196.html

Pumpkin Hookah
Mini Fuzz Pumpkin Hookah - RED

Kiran said...

Thanx NBow i think i don't have to use RedGate for Refreshing Cache

Kiran said...

Nice tip!

Kiran said...

Thanks, that's great :-)

Kiran said...

This thing has annoyed me for ages. Finally did a google search and got to this page. Thanks :-)

Kiran said...

AWESOME! Driving me Nuts!

Kiran said...

very useful article, thanks a lot :)