Hi again,
I guess I understood your requirement.
You want to pass a table variable in stored procedure as a parameter... :)
Well first you will need to define the structure of the table.
ex:
create table A(
AId int primary key,
AName varchar(20))
Then create a Table type and declare its structure too.
create type AType as Table(
AId int,AName varchar(20));
Thn create a Stored Procedure having table type as parameter:
create procedure Test
@x AType
as
insert into A(AId,AName)
select * from @x;
go
Next step would be to declare a table type variable and refer it to the tabletype wch we have created:
declare @y as AType;
Then insert some values in the above parameter..which shud be the actual data wat u wana enter..
Then pass this parameter to the stored proc n execute the stored proc.
insert into @y(AId,AName)
values(1,'Adidas')
(2,'Nike');
exec Test @y ;
Here you go...you are done...Happy Coding... :)