解决方案: |
在sqlserver的查询分析器中执行如下语句
执行前选择好对应的数据库:
if existsselect * from sysobjects where id = object_idN‘[dbo].[fa_ItemsManual_PK]‘
and OBJECTPROPERTYid, N‘IsPrimaryKey‘ = 1
ALTER TABLE fa_ItemsManual DROP CONSTRAINT fa_ItemsManual_PK GO
if exists select syscolumns.name from syscolumns inner join sysobjects on syscolumns.id=sysobjects.id
where syscolumns.name=‘ufguid‘
and
sysobjects.name=‘fa_ItemsManual‘
ALTER TABLE [dbo].[fa_ItemsManual] DROP COLUMN [ufguid] go
If Not ExistsSELECT name FROM sysobjects
WHERE xtype = ‘PK‘ and name= ‘PK_fa_ItemsManual_sCardNum‘
ALTER TABLE [dbo].[fa_ItemsManual]
WITH NOCHECK ADD CONSTRAINT [PK_fa_ItemsManual_sCardNum]
PRIMARY KEY NONCLUSTERED
[sCardNum]
ON [PRIMARY]
GO |