Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSMS question 1

Status
Not open for further replies.

Andrzejek

Programmer
Jan 10, 2006
8,509
US
I have SQL Server Management Studio 20.1.10.0 and most of what I do I can manage (pun intended). When I run CREATE TABLE everything seams to be OK, and when I right-click on my new table and do “Select top 1000 Rows”, the basic Select SQL shows up and works just fine, but – all fields and the table name have these squiggly red underlines stating: ‘Invalid column name’ or ‘invalid object name’. And intelisense does not give me available fields even though I can type them, and the SQL works just fine.

OK, so I do Refresh on this new table, no effect. Refresh on the database, no effect. The only way to get rid of those red lines is to close SSMS and restart it. Then all is fine with the world.

What am I doing wrong? What am I missing?

1725026614901.png
 
Th

New dataset.. Throw as USE at the start.. i.e. USE[NewTable]
Then the SQL, the new table name must be in the brackets. Good luck..
 
I think the query window makes a snapshop of known names and the knowledge of a new table and its columns doesn't get in. Instead of restarting the whole SSMS, create a new query window and it should know the new table.
 
The keyboard shortcut is CTRL-SHIFT-R. This refreshes the intellisense cache and prevents the red squigglies.
 
First of all, when you have selected one of the main databases, you don't need to specify here.
Query is Select * from tbl_name;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top