How can we help you today? How can we help you today?

"Invalid Object Name" when creating new tables.

Using SQL Prompt, I'm writing scripts to first create a new table, and then do some inserts against that new table. The scripts work but they show false errors. The error goes away if I restart SSMS, but as long as SSMS is open in the same session as I created the table, any use of that table is chock full of red underlines saying that none of the table/columns/objects exist. And this is after I've done the old "Ctrl+Shift+D" to refresh my object list.

Here's a screenshot of the issue:



I created that table, then opened a new query window to write that insert script, and it says the table doesn't exist. Even though it pulled the column names and definitions perfectly fine when creating the insert statement.

How do I make this false error not happen?
PaulKahl
0

Comments

6 comments

  • squigley
    Can you confirm what version of SQL Prompt and SSMS that you're seeing this on?
    squigley
    0
  • PaulKahl
    SQL Prompt Version 9.5.0.9311
    SSMS v17.9.1
    PaulKahl
    0
  • squigley
    Thanks for sending those details.
    Can you try upgrading to the latest version to see if that works better for you?
    squigley
    0
  • PaulKahl
    Sadly, that didn't fix the problem.



    I ran the Create, and the Insert, then commented them out and ran the Select - the select runs perfectly (because the table exists), but it indicates the table isn't there, and when you mouse over, says "Invalid object name 'PKTestTable'." (Even after the old Ctrl+Shift+D to rebuild the references.)
    PaulKahl
    0
  • squigley
    Thanks for sending that update and those replication steps.
    Using those steps I was able to recreate the same issue on my end. I'm going forward this to the developers and will let you know of our next steps.

    squigley
    0
  • squigley
    On my back and forth with the developers on this, we noticed that this issue still occurred even after removing SQL Prompt. Can you confirm if that's the case as well on your end?

    squigley
    0

Add comment

Please sign in to leave a comment.