开发者

Update statement fails because I have a column named order

开发者 https://www.devze.com 2023-01-16 11:14 出处:网络
I am trying to run an upd开发者_Go百科ate statement as follows... UPDATE tblDeductionSystem SET [ORDER] = [0RDER] + 6

I am trying to run an upd开发者_Go百科ate statement as follows...

UPDATE tblDeductionSystem 
   SET [ORDER] = [0RDER] + 6 
 WHERE [ORDER] >= 7 
   AND ScoringCriteriaTypeID = @CheerDeductionScoreSheetID

Sql Server if giving me invalid column name ORDER. I thought if I delimited the reserved word with the square brackets this would work.


If you copied that directly, your error is having a 0 (zero) instead of an O (the letter) on your [0rder]+6


What is [0RDER]? Is it yet another column? See this zero in there? 0 vs. O. Perhaps you need to change the font of your favorite sql editor.

On a side note, you see it just so happens that 0 and O are close together on QWERTY keyboards and you have to be careful not to hit 0 instead of O. Some l33t ppl actually prefer 0 to Os.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号