Is The Red Underline in SSMS Wrong?

Red underlines can trigger a wide range of emotions. They can be helpful but also annoying or scary. There are some teachers who specifically avoid writing in red when grading work because of red being such a negative color. That might be a bit extreme.

What about when you get a red underline in SSMS even though it’s “wrong?” Perhaps you created a table but over the course of working in SSMS that table name is now showing a red underline underneath indicating it’s not recognized. Let’s see what I’m talking about.

Let’s Get Negative

We’ll open a new query window in SSMS, create a new table, and add a few rows of test data:

CREATE TABLE YouCantSeeMe
(
	Id INT IDENTITY(1,1),
	TestValue VARCHAR(10)
);
GO

INSERT INTO YouCantSeeMe
VALUES ('Test1'),('Test2'),('Test3');
GO

If we leave this query window in place and open up a new query window, we will be able to query the table and not see any issues. But what if we close all of our query windows, open a new query window again, and attempt to query our table:

Our table name isn’t being shown in the dropdown. Did our table disappear when we closed the query window?

The YouCantSeeMe table is unrecognized. What if we try to query it anyway?

We’re able to select our data successfully.

Correction

So what’s the problem? Intellisense local cache is not updated and needs refreshed. The only steps needed are to click Edit > Intellisense > Refresh Local Cache

Or as you can see in the screenshot above, the keyboard shortcut of Ctrl+Shift+R. Once we refresh the Intellisense local cache and wait a few seconds, the red underline will disappear.

For a long time, this was one of those little annoyances that I ignored and thought “I’ll figure that out sometime later” and never got back around to it. The fix is simple and a quick keyboard shortcut away. Get that negativity out of your life.

Thanks for reading!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s