【SQL开源代码栏目提醒】:本文主要为网学会员提供进销存管理.sql,希望对需要进销存管理.sql网友有所帮助,学习一下!
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
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
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
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
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
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[盘点单_货号_fk]') and OBJECTPROPERTY(id, N'IsForeignKey'