Click here to Skip to main content
15,890,670 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All
I have created tables which has data, and are displaying correct details upon using the select clause, However the table is being underlined with RED displaying "Invalid object name..." if we bring the cursor near to it.

A similar kind of error occurred while using the creating table syntax, where i used foreign key , the referenced table was being underlined as RED, displaying "There is no primary key in table being referenced..", later i added the Primary key, but the underlined warning was still there and the table creation was done although.

Any ideas on the reasons behind them and how do we resolve it??

What I have tried:

I was wondering if i had the option to attach a screenshot for review:(
Posted
Updated 24-Aug-16 0:59am

1 solution

Ignore it.
SSMS doesn't refresh it's windows often: I often have queries with red underlines that run and produce the results I want.
If it really bothers you, copy the whole query to the clipboard, open a new query window and paste it in. The underline will vanish because the new query window was loaded with the new table definitions.
 
Share this answer
 
Comments
mousau 24-Aug-16 7:36am    
Hi Griff
Thanks for the response.I am accessing sql server 2012 through remote client machine. Tried the mentioned trick, but its not working now.. i assume i gotta logoff and then retry!
Otherwise there are no problems with the results:)
Thank You
Regards

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900