--定义一个 type
create type justPK as table(PK int);
--定义一个变量对象
declare @TPpkTable AS justPK
--为表赋值
insert into @TPpkTable(PK)
select 1
union select 2
--使用的存储过程
create proc PR_Update进货物品表totalPrices
@Table justPK readonly
as
update dbo.进货物品表 set totalPrices=quantity * unitPrice where PK in(select PK from @Table)
可以通过 sys.types 查找到定义的type