in mssql2000, could not update column

[expired user #7236]'s profile image [expired user #7236] posted 11 years ago in General Permalink
in mssql2000, could not update a column.
UPDATE TOP(1) tb SET "zb"=411 WHERE "rq"='2012-01-19' AND "zb"=41;
SQL Error (156),near TOP
ansgar's profile image ansgar posted 11 years ago Permalink
Seems Microsoft introduced TOP(x) for UPDATES and DELETED in MSSQL 2005. Sigh...
Code modification/commit from ansgar.becker, 11 years ago, revision 8.0.0.4495
TOP(x) clause for UPDATES + DELETES introduced in MSSQL 2005. Do not use that on older servers. See http://www.heidisql.com/forum.php?t=13289
ansgar's profile image ansgar posted 11 years ago Permalink
r4495 leaves that TOP(x) clause away from the UPDATE query. Makes it slightly more unsafe, unless you have primary or unique keys in your tables.

Please login to leave a reply, or register at first.