在SQL SERVER 2008种使用表值参数

--定义一个数据类型
create type userlist_tabletype as table(
	id int not null default 0,
	name varchar(50) not null default ''
)
go

--定义存储过程
create proc dbo.pr_usetabletype
	@t userlist_tabletype readonly
as
	select * from @t
go

--测试
declare @tb userlist_tabletype
insert into @tb (id,name) values (1,'henry'),(2,'lily'),(3,'jason')
exec pr_usetabletype @tb

  

posted @ 2012-05-25 13:59  ifanxp  阅读(240)  评论(0编辑  收藏  举报