Loading ...

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

Who is online?  0 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.

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

Posted: 5/13/2010

Lurker 50  points  Lurker
  • Joined on: 3/28/2010
  • 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.


tags sql

Posted: 5/14/2010

Professional 8505  points  Professional
  • Joined on: 5/3/2010
  • Posts: 391
  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

Lurker 50  points  Lurker
  • Joined on: 3/28/2010
  • Posts: 10

Thanks.


Page 1 of 1 (3 items)