Execute store procedure with input and output parameters

By | January 10, 2021

Syntax for Executing store procedure with input and output parameters is as below,

Declare @Count int
exec StoredProcedureName @inputparameters = input parameter value, @outputParamsOfSP = @rowCount output
For example, 
Lets say you are building store procedure to get details of employee by passing 
employee Id, and that sp should return employee is permanent or contractual.

Declare @EmployeeTypeValue as nvarchar(max)
EXEC dbo.uspGetEmployeeWorkType @EmployeeId = 'E103', @OEmployeeType = @EmployeeTypeValue output