An exception occurred when sqlserver executed the update statement, and there was a syntax error near t

I used to use Oracle for development before, and occasionally use mysql. Now when I encounter Kingdee's k3 system in the project, I have to use sqlserver, which seems to be the same sql language. It feels awkward to change the database type.
Insert picture description here

When performing a simple update operation in sqlserver, an error is reported: there is an error near xxx.
This, the error message is a bit vague.

	update user t set t.age = 27 where t.name = 'wuwl'

Give a similar example as above, this way of writing will report an error in sqlserver, the reason is **Cannot use aliases**.
And this way of writing is fully supported in oracle, and you can only adapt slowly to the locals.

	update user set user.age = 27 where user.name = 'wuwl'

The following writing is supported in sqlserver, of course, it is also OK in other relational databases.

Guess you like

Origin blog.csdn.net/qq_41885819/article/details/107042957