Author: Unknown
•20:42
[转] http://www.cnblogs.com/hanguoji/archive/2007/01/19/413997.html

--删除约束
ALTER TABLE CustomData DROP CONSTRAINT FK_CustomData_CustomFormatInfo
GO
--关闭递增插入属性
SET IDENTITY_INSERT OFF
--打开递增插入属性
SET IDENTITY_INSERT ON
--修改增加约束
ALTER TABLE [CustomFormatInfo] WITH NOCHECK ADD
CONSTRAINT [PK_CustomFormatInfo] PRIMARY KEY CLUSTERED
(
[CustomFormatID]
) ON [PRIMARY]
GO
--修改表增加外键约束
ALTER TABLE [CustomData] ADD
CONSTRAINT [FK_CustomData_CustomFormatInfo] FOREIGN KEY
(
[CustomFormatID]
) REFERENCES [CustomFormatInfo] (
[CustomFormatID]
)
GO
This entry was posted on 20:42 and is filed under . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

0 评论: