cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
martinav
Community Champion
Community Champion

SQL Primary key - invalud coumn name???

Always some stupid detail...

 

Very easy to do... but, why do I get an error on the column name being invalid?  It isnt.  

 

image.png

2 ACCEPTED SOLUTIONS

Accepted Solutions
martinav
Community Champion
Community Champion

Huh... i renamed it a couple of times, same result... Design looks fine, no errors...

 

BUT... I exited studio, and opened it again... it was fine after that.  Strange.

View solution in original post

timl
Super User III
Super User III

Just for info, the red squiggly lines often appear in SSMS when you rename/add objects and the Intellisense becomes out of sync.

Rather than close/reopen SSMS, a quicker way is to use the shortcut <Ctrl><Shift><R>, or to select the Refresh Local Cache option in the Edit > IntelliSense menu.

 

image.png

View solution in original post

9 REPLIES 9
wyotim
Resident Rockstar
Resident Rockstar

That is interesting, considering that SSMS generated the query! You would think it would know the column names.

 

If you look at the Design (just above the Select Top 1000 Rows when you right click on the table), does that have the same column name or any errors?

martinav
Community Champion
Community Champion

Huh... i renamed it a couple of times, same result... Design looks fine, no errors...

 

BUT... I exited studio, and opened it again... it was fine after that.  Strange.

View solution in original post

wyotim
Resident Rockstar
Resident Rockstar

Glad you were able to solve the issue! I have noticed some occasional refresh issues in SSMS. Hitting F5 a few times for good measure never hurts. Smiley Very Happy

martinav
Community Champion
Community Champion

Yes, I did several F5s at many levels.  The only thing that resolved was an exit, @wyotim .  I did it a second time, and same thing.

wyotim
Resident Rockstar
Resident Rockstar

That is a bit of a bummer to hear! Good to know though. Thanks for sharing your experience. I know it will help me and anyone else who finds this thread in the future! 

martinav
Community Champion
Community Champion

The table actually executes just fine, despite the red squiggly, and such.  There was no other apparent issue.

timl
Super User III
Super User III

Just for info, the red squiggly lines often appear in SSMS when you rename/add objects and the Intellisense becomes out of sync.

Rather than close/reopen SSMS, a quicker way is to use the shortcut <Ctrl><Shift><R>, or to select the Refresh Local Cache option in the Edit > IntelliSense menu.

 

image.png

View solution in original post

wyotim
Resident Rockstar
Resident Rockstar

Thanks for the info @timl! That makes total sense. You rock!

timl
Super User III
Super User III

Hehe, thanks @wyotim! You rock too!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (163)