The formal parameter "@mode" was not declared as an OUTPUT parameter, but the actual parameter passed in the requested output

I have this stored procedure:

ALTER PROCEDURE spCertificationType 
    @result nvarchar(15) output,
    @mode int 
AS
BEGIN
    if @mode = 1
    begin
        exec spGeneratedID 2, @result output
        print @result
    end
END

but when I tried to execute it, he has this error

The formal parameter "@mode" was not declared as an OUTPUT parameter, but the actual parameter was passed in the requested output.

I tried to set @modeas output as follows:

ALTER PROCEDURE spCertificationType 
    @result nvarchar(15) output,
    @mode int output
AS
BEGIN
    if @mode = 1
    begin
        exec spGeneratedID 2, @result output
        print @result
    end
END

but it returns a null value.

Any fix for this? Thanks in advance.

+4
source share
2 answers

, , : - : -

http://www.codeproject.com/Articles/126898/Sql-Server-How-To-Write-a-Stored-Procedure-in-SQL

ALTER PROCEDURE spCertificationType 

     @mode int,
     @result nvarchar(15) output
 AS
 BEGIN
     if @mode = 1
   begin
    exec spGeneratedID 2, @result output
    print @result
   end
END
+8

.

  • OUTPUT SP.
  • .
  • SQLDataSource Configure Data Source . , SP , , OUTPUT.
-1

All Articles