if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_分录表_凭证表]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[分录表] DROP CONSTRAINT FK_分录表_凭证表
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[本期汇总账簿_科目代码_fk]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[本期汇总账簿] DROP CONSTRAINT 本期汇总账簿_科目代码_fk
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[本期明细账簿_科目代码_fk]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[本期明细账簿] DROP CONSTRAINT 本期明细账簿_科目代码_fk
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[分录表_科目代码_fk]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[分录表] DROP CONSTRAINT 分录表_科目代码_fk
GO