sql server 创建主键
代码
if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[主键名称]') and OBJECTPROPERTY(id, N'IsPrimaryKey') = 1)
ALTER TABLE [dbo].[表名] WITH NOCHECK ADD
CONSTRAINT [主键名] PRIMARY KEY CLUSTERED
(
[字段] ASC
)WITH FILLFACTOR = 90 ON [PRIMARY]
ALTER TABLE [dbo].[表名] WITH NOCHECK ADD
CONSTRAINT [主键名] PRIMARY KEY CLUSTERED
(
[字段] ASC
)WITH FILLFACTOR = 90 ON [PRIMARY]
继续追寻。。。。。。