question

kiln avatar image
0 Votes"
kiln asked Cathyji-msft commented

Synonyms that reference local database show as "Invalid object name 'mysynonym'" in intellisense in SSMS

Synonyms that reference local database show as "Invalid object name 'mysynonym'" in IntelliSense with SSMS 18.9.1, at least they do for me. I have found mentions of this "bug" going back to at least 2011. There is still no fix for this or workaround, other than defeating IntelliSense ? The use of synonyms isn't exactly rare. Having the query window full of red squiggles more or less defeats the utility of IntelliSense . I've tried opening, closing, clearing the IntelliSense cache, nothing works. It's like this on all of the SSMS instances I have access to.

sql-server-generalsql-server-transact-sql
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

kiln avatar image
0 Votes"
kiln answered Cathyji-msft commented

In the original post I mention that refreshing the cache, etc didn't help. The synonyms work so obviously they refer to valid objects, if that's what you mean.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @kiln,

Welcome to Q&A forum.

Make sure that the selected DB is the one where the object is.

Did you use refresh the data cached by Intellisense? Edit -> IntelliSense -> Refresh Local Cache

0 Votes 0 ·
kiln avatar image
0 Votes"
kiln answered

Anyone out there have useful input on this?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

TomPhillips-1744 avatar image
0 Votes"
TomPhillips-1744 answered

I use synonyms a lot and do not have that issue using SSMS v18.9.1. It must be something to do with your cache.

I find Intellisense almost not worth bothering with. Some of the time it doesn't work at all.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.