Course Content
SQL SERVER
About Lesson

/*
Stored Procedure can return only int
basically it is used to return a status value

*/
alter procedure sp_GetTotalEmp
as
begin
declare @x int;
select @x=count(eno) from tblemp;
return @x;
end

declare @y int;
execute @y=sp_GetTotalEmp
select @y TotalEmployees;

create procedure sp_GetTotalEmp_Sal(@te int output, @ts int output)
as
begin
select @te=count(eno),@ts=sum(sal) from tblemp;
end

declare @a int;
declare @b int;
exec sp_GetTotalEmp_Sal @a output,@b output
select @a TotalEmp, @b TotalSal;