Update failed because I have a column called order

I am trying to run the update statement as follows:

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

Sql Server, if you gave me the wrong column name ORDER. I thought that if I separated the reserved word with square brackets, it would work.

+3
source share
2 answers

If you copied this directly, your error has 0 (zero) instead of O (letter) on your [0rder]+6

+4
source

What is [0RDER]? Is this another column? Look at that zero? 0against O. You may need to change the font of your favorite sql editor.

, , , 0 O QWERTY, , 0 O. l33t ppl 0 Os.

+1

Source: https://habr.com/ru/post/1765376/


All Articles