Table not recognising new column

  • Hi All,

    Im new to the forum 🙂

    Iv just added a new column to my table and for some reason it says its invalid,

    the column name is DateCreated and iv even change the column name to [DateCreated] and still it says noooooooooo

    iv attached two screen prints one of it saying invalid column in a SP and the other is a layout of the table it self.

    the column is laid out as a char if that makes a difference?

    the reason its a char is because im VB.net im building the date as a string and then passing that through to SQL.

  • Edit -> Intellisense -> Refresh Local Cache

    (or Ctrl-Shift-R)

    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
  • ooo well would you look at that haha!

    Thanks for the response 🙂

  • It wasn't SQL telling you the column was invalid, had you run the insert it would have run just fine. It was just Management Studio's Intellisense. It doesn't update after every schema change (can be good, it could really hurt a server doing that), so you need to wait, ignore the warnings or manually update the 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
  • p.s. Store dates in a datetime. You're setting yourself up for a world of pain by storing it as a char. Doesn't matter that it's passed as a string, SQL can and will convert as long as it understands the format.

    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
  • Oh ok thanks, iv only ever used SQL for bits and pieces but i want to go more in depth with it 🙂 thanks for your advice and notes 🙂

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

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