Who is online?  206 guests and 0 members
home »forums »asp.net topics »data access »Cannot use the OUTPUT option when passing a constant to a stored procedure.

Cannot use the OUTPUT option when passing a constant to a stored procedure.

Topic RSS Feed

Posts under the topic: Cannot use the OUTPUT option when passing a constant to a stored procedure.

Posted: 5/13/2010 8:19:30 PM

Lurker 50  points  Lurker
  • Joined on: 3/28/2010 12:49:37 PM
  • Posts: 10

Hi experts,

I am tring to execute my stored procedure in sql like this:


DECLARE @RowsAffected INT
EXEC MySP 2,1,NULL,NULL,NULL,2,4,0,@RowsAffected=0 OUTPUT
SELECT @RowsAffected

 

But I am getting this issue "Cannot use the OUTPUT option when passing a constant to a stored procedure."

 

Please help.


sql

Posted: 5/14/2010 7:12:57 AM

Contributor 2499  points  Contributor
  • Joined on: 5/3/2010 8:45:04 PM
  • Posts: 145
answered  Answered

Try the following way

DECLARE @RowsAffected as INT
SET @RowsAffected=0
EXEC MySP 2,1,NULL,NULL,NULL,2,4,0,@RowsAffected OUTPUT
SELECT @RowsAffected

Regards,
Hajan


Posted: 5/14/2010 7:50:28 PM

Lurker 50  points  Lurker
  • Joined on: 3/28/2010 12:49:37 PM
  • Posts: 10

Thanks.


Page 1 of 1 (3 items)