Step-1:
--create
Emp type as table
create
type Emp as
table (Id
int ,Name
varchar(50)
null)
Step-2:
--create
stored procedure with table variable parameter
create
proc sp_GetEmp
(@In_emp
as
dbo.Emp
readonly
)
as
begin
set
nocount
on
select
*
from
@In_emp
set
nocount
off
end
Step-3:
--Insert
some dummy data
declare
@temp_emp as Emp
insert
into
@temp_emp values(1,'rakesh'),(2,'raki'),(3,'ramu'),(4,'raju')
Step
-4:
--exec
stored procedure
exec
sp_GetEmp @temp_emp
Comments
Post a Comment