时间:2021-07-01 10:21:17 帮助过:2人阅读
create type t_table_type as table
(
id int,
name varchar(32),
sex varchar(2)
)
?
go
--创建存储过程
CREATE PROC u_test
(@t t_table_type readonly)
as
begin
???? select * from @t
????
end
?
--调用存储过程
declare @t t_table_type
?
insert into @t values (1,‘a‘,‘f‘)
insert into @t values (2,‘a‘,‘f‘)
insert into @t values (3,‘a‘,‘f‘)
insert into @t values (4,‘a‘,‘f‘)
?
exec u_test @t
SQL SERVER 2008 存储过程传表参数
标签: