sql 增加键约束 删除主记录在其他表中的相关记录


ALTER TABLE [dbo].[t_workflow_approval]  WITH CHECK ADD  CONSTRAINT [FK_t_workflow_approval_t_workflow_form] FOREIGN KEY([indexid])
REFERENCES [dbo].[t_workflow_form] ([id])
ON UPDATE CASCADE
ON DELETE CASCADE
GO

ALTER TABLE [dbo].[t_workflow_approval] CHECK CONSTRAINT [FK_t_workflow_approval_t_workflow_form]
GO

posted @ 2012-05-25 14:22  y0umer  阅读(176)  评论(0编辑  收藏  举报