error with update command
update EMP
set fn = @FN
set ln = @LN
set DOB = @DOB
where id = @ID
when i execute the above command. I am gett开发者_C百科ing the follwing error.
Incorrect syntax near '='.
can we update more then one field with single uadate command.
You forgot to delimit the fields & you only state SET
once;
update EMP
set fn = @FN,
ln = @LN,
DOB = @DOB
where id = @ID
It is possible to UPDATE multiple columns at the same time. The syntax in this case would look like the following:
UPDATE "table_name"
SET column_1 = [value1], column_2 = [value2]
WHERE {condition}
Ref: http://www.1keydata.com/sql/sqlupdate.html
Hope this helps.
精彩评论