1

I'm creating a new table and in the process creating two foreign keys. The tables with the primary keys referenced exist but Intellisense is giving the error message: "Foreign key. . .references invalid table 'ROLES'."

Why does SQL Server Management Studio not recognize these tables?

5

In short, the tables are not recognized because the IntelliSense local cache is not up to date.

While you are in the Query Editor window you can press CTRL + SHIFT + R to refresh the cache. This should update IntelliSense's cache and the red squiggles should disappear.

Please see this link for more information.

1

Its a normal behavior as the IntelliSense does not recognize the objects that are not cached.

I use the Refresh cache option in Edit menu each time I see this.

Edit -> IntelliSense -> Refresh Local Cache

Not the answer you're looking for? Browse other questions tagged or ask your own question.