declare @s nvarchar(4000)
select @s='alter table '+quotename(object_name(parent_obj))
+' drop constraint '+quotename(name)
from sysobjects
where xtype='PK'
and object_name(parent_obj)=N'要删除主键的表名'
exec(@s)