RowCount 説明SET ROWCOUNT 4 -- 指定4行(和 TOP N 有點類似)
RowCount 説明
GO
RowCount 説明
UPDATE titles
RowCount 説明
SET advance = 5000
RowCount 説明
WHERE advance >= 5000   -- 只能改變指定的4行 
RowCount 説明
GO
RowCount 説明
SET ROWCOUNT 0
RowCount 説明
select * from titles  WHERE advance >= 5000
RowCount 説明
RowCount 説明
SET ROWCOUNT 0 --- 取消指定行數
RowCount 説明--
---------------------------------------------
RowCount 説明
UPDATE authors SET au_lname = 'Jones'
RowCount 説明
WHERE au_id = '999-888-7777'
RowCount 説明
IF @@ROWCOUNT = 0  --- 判斷是否有變化 
RowCount 説明
   begin
RowCount 説明   
print 'Warning: No rows were updated'
RowCount 説明  
end
RowCount 説明
RowCount 説明

相关文章: