use output parameter in stored procedure

Total Post:341

Points:2389
 930  View(s)
Ratings:
Rate this:
 I want to use output parameter in stored procedure please help me.
  1. Post:281

    Points:2003
    Re: use output parameter in stored procedure

    Setting up output paramters for a stored procedure is basically the same as setting up input parameters, the only difference is that you use the OUTPUT clause after the parameter name to specify that it should return a value.  The output clause can be specified by either using the keyword "OUTPUT" or just "OUT".

    create proc Sp_EmpData

    (

    @totalcount int output

    )

    as

    begin

    select @totalcount=(select count(*) from Employee);

    end

    DECLARE @totalcount int

    EXEC Sp_EmpData @totalcount = @totalcount OUTPUT

    select @totalcount

      Modified On Apr-10-2018 06:25:17 AM

Answer