From: Harlan Messinger on
In Management Studio with SQL Server Express 2008, connected to a SQL
Server and working in a query editor window, when I write a series of
statements that include some that create tables or new columns within
tables, the Intellisense doesn't take the new objects into account in
code that follows it. Example:

ALTER TABLE Foo ADD quantity int NOT NULL
GO

CREATE PROCEDURE Blah(@id int, @quantity int) AS
BEGIN

INSERT INTO Foo (id, quantity) VALUES (@id, @quantity)
END
GO

EXEC Blah 35, 15

Intellisense won't give me quantity as an option in the stored
procedure, and will put a squiggly line under it. Likewise, the
reference to Blah in the last line will be underline.

I can accept that Intellisense only goes as far as reading the current
structure of the database in parsing the contents of the query window.
However, suppose I highlight the ALTER statement and execute it. So now
table Foo has a column called quantity.

It doesn't matter. Even when I click the Parse icon and it reports that
my code is correct, the squiggly lines remain. This is true even if I
save the script, close it, and reopen it, and then disconnect from the
database and reconnect. The only way I've found to get rid of the
squiggly line under "quantity" is to close Management Studio and reopen
it. And when I do that, there's still a squiggly line under the second
Blah, and it remains even after I've executed the part of the script
that creates the procedure. Etc.

Does Management Studio provide a means of resetting the parser's context
without shutting it down?
From: Plamen Ratchev on
You can refresh the IntelliSense cache: Ctrl+Shift+R or Edit -> IntelliSense -> Refresh Local Cache.

--
Plamen Ratchev
http://www.SQLStudio.com
From: Harlan Messinger on
Plamen Ratchev wrote:
> You can refresh the IntelliSense cache: Ctrl+Shift+R or Edit ->
> IntelliSense -> Refresh Local Cache.
>
Thanks!