【发布时间】:2011-06-18 11:25:32
【问题描述】:
我正在尝试使用主键创建表变量。这两种说法有什么区别?为什么第一个不起作用?
--This does not work
declare @tabvar table (
rowid int identity(1, 1) not null,
var1 int null,
constraint PK_tabvar_rowid primary key clustered (rowid)
)
--This works
declare @tabvar1 table (
rowid int identity(1, 1) not null primary key clustered,
var1 int null
)
【问题讨论】:
标签: sql-server sql-server-2008 indexing