0

I need to Update table, select rows that were updated, and then get a count on those rows. Is it possible to do this in 1 stored procedure? I'm working in a c# services app and using SQL Server. What's a good alternative if it is not doable.

CSharper
  • 5,420
  • 6
  • 28
  • 54
  • Typically I would add a batch number column to the table and include the batch number column in my update statement, so I can reference it when I need it. – Khan Aug 01 '13 at 20:23

1 Answers1

0

After updated you can use @@ROWCOUNT for example

update tab
  set col = value

select @Val = @@ROWCOUNT
Robert
  • 25,425
  • 8
  • 67
  • 81