Invalid column name on sql server update after column create

后端 未结 4 1451
暗喜
暗喜 2020-12-06 09:34

Does anyone see what\'s wrong with this code for SQL Server?

IF NOT EXISTS(SELECT *
              FROM   sys.columns
              WHERE  Name = \'OPT_LOCK\'         


        
4条回答
  •  自闭症患者
    2020-12-06 10:15

    The root cause of the error is the newly added column name is not reflected in the sys.syscolumns and sys.columns table until you restart SQL Server Management Studio.

提交回复
热议问题