-- 假设表名为bbb,新加的字段为f3
declare @name varchar(200)
select @name=name from sysobjects where xtype='pk' and parent_obj=object_id('bbb')
exec('alter table bbb drop constraint '+ @name)
go
alter table bbb with nocheck add constraint [pk_bbb] primary key (F1,F3)
--写个例子,你看看,表名叫 test 主键 pk_test
ALTER TABLE [dbo].[test] drop
CONSTRAINT [PK_test]
GO
ALTER TABLE [dbo].[test] ADD d varchar(50) not null default ''
GO
ALTER TABLE [dbo].[test] WITH NOCHECK ADD
CONSTRAINT [PK_test] PRIMARY KEY CLUSTERED
(
[a],
[b],
[c],
[d]
) ON [PRIMARY]
GO