Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2002
    Posts
    2

    Question Unanswered: SP that will return how many rows a DELETE stmnt will affect

    Does anyone know of a stored procedure that you can send an UPDATE, INSERT or DELETE statement and return the rows that will be affected by that SQL statement?

    I come from an Access background and am used to seeing how many rows will be updated before I actually complete the query.

    In SQL,I convert the SQL to a SELECT and get a COUNT. I wasnt sure if there was a stored procedure that would do that for me. Thanks.!!!

    neil
    Last edited by nwilgus; 07-24-03 at 13:34.

  2. #2
    Join Date
    Jun 2003
    Location
    Colombo, Sri Lanka
    Posts
    6

    Re: SP that will return how many rows a DELETE stmnt will affect

    Originally posted by nwilgus
    Does anyone know of a stored procedure that you can send an UPDATE, INSERT or DELETE statement and return the rows that will be affected by that SQL statement?
    You can return the @@ROWCOUNT internal variable as an output variable of the stored procedure. @@ROWCOUNT contains the number of rows effected by the last SQL command.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •