Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


help with output parameter in a stored procedure

Posted on 2007-08-10
Medium Priority
Last Modified: 2013-11-05
hi, I would like to add an output parameter to this stored procedure.

I would need output param to be valorized with the 'records affected' value


Thanks and regards
Question by:repzat
1 Comment
LVL 143

Accepted Solution

Guy Hengel [angelIII / a3] earned 1000 total points
ID: 19668496
create procedure backup_Proc
( @rows_affected int OUTPUT )
       insert into tableC (field1, field2, field3, field4)
       select B.field1, B.field2, B.field3, B.field4 from  A,B
              where A.guid = B.guid
                     and A.deleted = 1

         delete B from  A,B
              where A.guid = B.guid
                     and A.deleted = 1
SET @rows_affected = @@ROWCOUNT

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
MSSQL DB-maintenance also needs implementation of multiple activities. However, unprecedented errors can hamper the database management. In that case, deploying Stellar SQL Database Toolkit ensures fast and accurate database and backup repair as wel…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question