02 August 2012

Invalid column name - sql server

This case that happened to me when creating SQL table column

I created a SQL table column.
Then I received the following message on StoredProcedure or even in Select.

Invalid column name


Invalid column name


Invalid column name
What can be problem
  • 2 tables or one table with both columns
  • use Stored procedures to decouple scope
I wrote this query to see if there is a problem with my columns

select   name  from  sys.columns  where  object_id = object_id('Your_Table')

I didn't see any problem with my columns

OK....

What to do
  • Go to the table where they are added to the column, check whether it has a trigger (for each table by columns also have triggers), and if there is a table trigger, stopped him, and suddenly everything starts to work. If you open the trigger you will understand that change is copying the data to another table that there has to add the column and so on.
  • Press CTRL+SHIFT+R  on table !!!
It will solve your problem (I hope :) )

Yours,
Roi



No comments:

Post a Comment