Counting the number of deleted rows in a SQL Server stored procedure

前端 未结 7 1749
借酒劲吻你
借酒劲吻你 2021-02-06 20:26

In SQL Server 2005, is there a way of deleting rows and being told how many were actually deleted?

I could do a select count(*) with the s

相关标签:
7条回答
  • 2021-02-06 21:28

    Just do this:

    SET NOCOUNT off ;
    SELECT @p1 = @@ROWCOUNT
    

    where p1 is the output parameter you set in the stored procedure. Hope it helps.

    0 讨论(0)
提交回复
热议问题