最佳答案
如何获取存储过程(SQLServer2005)中受 UPDATE 查询影响的行数作为结果集。例如:。
CREATE PROCEDURE UpdateTables
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
UPDATE Table1 Set Column = 0 WHERE Column IS NULL
UPDATE Table2 Set Column = 0 WHERE Column IS NULL
UPDATE Table3 Set Column = 0 WHERE Column IS NULL
UPDATE Table4 Set Column = 0 WHERE Column IS NULL
END
然后返回:
Table1 Table2 Table3 Table4
32 45 0 3