declare @a varchar(20)
select @a=c.name from syscolumns a,sysconstraints b,sysobjects c where a.id=object_id('表名') and a.name='主鍵列名' and a.id=b.id and b.constid=c.id and c.name like 'PK%'
exec('alter table 表名 drop constraint '+@a)