SQL Server how to update only one row in database?
you can use ROWCOUNT
SET ROWCOUNT 1
UPDATE table1
SET name2 = '01'
WHERE name1='xx'
SET ROWCOUNT 0
or you can use update top
UPDATE TOP (1) table1
SET name2 = '01'
WHERE name1='xx'
you can use ROWCOUNT
SET ROWCOUNT 1
UPDATE table1
SET name2 = '01'
WHERE name1='xx'
SET ROWCOUNT 0
or you can use update top
UPDATE TOP (1) table1
SET name2 = '01'
WHERE name1='xx'