Invalid Column Name error

  • When I select the top 1000 rows from one of my tables, I can see the script used in the top half of my screen and the results in the bottom. The problem I'm having is that 3 of the column names in the script are underlined in red with an error message of 'Invalid Column Name'.

    The results part of the screen however show the columns and the data stored inside.

    Why am I being told the columns are invalid when they are clearly there in the table.

    Many thanks

    Stuart.

  • maybe the columns have only just been added, so the intellisense can't see it?

    i press ctrl+shift+r to refresh.

  • Edit->Intellisense->Refresh Local cache

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks for the help. That seems to have worked.

  • For what it's worth, I've noticed that in scripts where I first drop a table and then create it, I have to include the "GO" command after the initial DROP statement. Just in case anyone Googling this runs into that issue...


    "If I had been drinking out of that toilet, I might have been killed." -Ace Ventura

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply