?? 生產(chǎn)管理系統(tǒng).sql
字號:
drop table [dbo].[調(diào)撥單]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[調(diào)撥單歷史]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[調(diào)撥單歷史]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[調(diào)整庫存歷史]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[調(diào)整庫存歷史]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[資源日程表]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[資源日程表]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[資源日程表歷史]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[資源日程表歷史]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[資源消耗定額]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[資源消耗定額]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[資源清單]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[資源清單]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[資源負(fù)荷報表]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[資源負(fù)荷報表]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[運(yùn)行參數(shù)表]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[運(yùn)行參數(shù)表]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[進(jìn)退貨單]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[進(jìn)退貨單]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[進(jìn)退貨單歷史]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[進(jìn)退貨單歷史]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[進(jìn)銷存卡片]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[進(jìn)銷存卡片]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[選擇記帳記錄表]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[選擇記帳記錄表]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[采購訂單]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[采購訂單]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[采購訂單o]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[采購訂單o]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[采購訂單歷史]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[采購訂單歷史]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[采購訂單發(fā)布]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[采購訂單發(fā)布]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[采購訂單審核]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[采購訂單審核]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[采購訂單接收]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[采購訂單接收]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[銷售單]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[銷售單]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[銷售單歷史]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[銷售單歷史]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[銷售訂單]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[銷售訂單]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[銷售訂單歷史]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[銷售訂單歷史]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[銷售預(yù)測]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[銷售預(yù)測]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[銷售預(yù)測歷史]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[銷售預(yù)測歷史]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[銷退貨單歷史]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[銷退貨單歷史]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[領(lǐng)料單]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[領(lǐng)料單]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[領(lǐng)料單temp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[領(lǐng)料單temp]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[領(lǐng)料單歷史]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[領(lǐng)料單歷史]
GO
CREATE TABLE [dbo].[bom信息狀態(tài)] (
[狀態(tài)代碼] [char] (1) NOT NULL ,
[狀態(tài)描述] [varchar] (50) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[bom狀態(tài)] (
[狀態(tài)代碼] [char] (1) NOT NULL ,
[狀態(tài)描述] [varchar] (50) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[jzh每月結(jié)轉(zhuǎn)日期表] (
[月份] [int] NOT NULL ,
[全稱] [char] (4) NULL ,
[結(jié)轉(zhuǎn)日期] [int] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[mrp0] (
[內(nèi)部編號] [int] IDENTITY (1, 1) NOT NULL ,
[物料編號] [char] (20) NULL ,
[年份] [int] NULL ,
[計劃期] [int] NULL ,
[期初庫存] [decimal](18, 4) NULL ,
[預(yù)計入庫] [decimal](18, 4) NULL ,
[預(yù)計采購] [decimal](18, 4) NULL ,
[預(yù)計外協(xié)] [decimal](18, 4) NULL ,
[預(yù)計出庫] [decimal](18, 4) NULL ,
[需求數(shù)量] [decimal](18, 4) NULL ,
[建議采購] [decimal](18, 4) NULL ,
[建議生產(chǎn)] [decimal](18, 4) NULL ,
[建議外協(xié)] [decimal](18, 4) NULL ,
[預(yù)計庫存] [decimal](18, 4) NULL ,
[安全庫存] [decimal](18, 4) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[mrpcalcd] (
[內(nèi)部編號] [int] IDENTITY (1, 1) NOT NULL ,
[物料編號] [char] (14) NOT NULL ,
[年份] [int] NOT NULL ,
[計劃期] [int] NOT NULL ,
[期初庫存] [decimal](18, 4) NULL ,
[毛需求] [decimal](18, 4) NULL ,
[預(yù)計入庫] [decimal](18, 4) NULL ,
[預(yù)計出庫] [decimal](18, 4) NULL ,
[預(yù)計庫存] [decimal](18, 4) NULL ,
[凈需求] [decimal](18, 4) NULL ,
[計劃產(chǎn)出] [decimal](18, 4) NULL ,
[計劃投入] [decimal](18, 4) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[mrpcalcm] (
[低層碼] [int] NULL ,
[物料編號] [char] (14) NULL ,
[計劃代碼] [char] (5) NULL ,
[當(dāng)前庫存] [decimal](18, 4) NULL ,
[逾期入庫] [decimal](18, 4) NULL ,
[逾期出庫] [decimal](18, 4) NULL ,
[提前期] [int] NULL ,
[批量] [decimal](18, 4) NULL ,
[安全庫存] [decimal](18, 4) NULL ,
[可用庫存] [decimal](18, 4) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[mrp歷史] (
[內(nèi)部編號] [int] IDENTITY (1, 1) NOT NULL ,
[發(fā)布編號] [char] (20) NULL ,
[物料編號] [char] (14) NOT NULL ,
[年份] [int] NOT NULL ,
[計劃期] [int] NOT NULL ,
[期初庫存] [decimal](18, 4) NULL ,
[毛需求] [decimal](18, 4) NULL ,
[預(yù)計入庫] [decimal](18, 4) NULL ,
[預(yù)計出庫] [char] (10) NULL ,
[預(yù)計庫存] [decimal](18, 4) NULL ,
[凈需求] [decimal](18, 4) NULL ,
[計劃產(chǎn)出] [decimal](18, 4) NULL ,
[計劃投入] [decimal](18, 4) NULL ,
[能力計算標(biāo)記] [char] (1) NOT NULL ,
[生產(chǎn)訂單標(biāo)記] [char] (1) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[mrp發(fā)布時間] (
[發(fā)布編號] [int] IDENTITY (1, 1) NOT NULL ,
[年份] [int] NULL ,
[計劃期] [int] NULL ,
[發(fā)布時間] [char] (20) NULL ,
[發(fā)布人] [char] (10) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[mrp正式] (
[內(nèi)部編號] [int] IDENTITY (1, 1) NOT NULL ,
[發(fā)布編號] [char] (20) NULL ,
[物料編號] [char] (14) NOT NULL ,
[年份] [int] NOT NULL ,
[計劃期] [int] NOT NULL ,
[期初庫存] [decimal](18, 4) NULL ,
[毛需求] [decimal](18, 4) NULL ,
[預(yù)計入庫] [decimal](18, 4) NULL ,
[預(yù)計出庫] [char] (10) NULL ,
[預(yù)計庫存] [decimal](18, 4) NULL ,
[凈需求] [decimal](18, 4) NULL ,
[計劃產(chǎn)出] [decimal](18, 4) NULL ,
[計劃投入] [decimal](18, 4) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[mrp簡單計算] (
[內(nèi)部編號] [int] IDENTITY (1, 1) NOT NULL ,
[年份] [int] NULL ,
[計劃期] [int] NULL ,
[物料編號] [char] (14) NULL ,
[用量] [decimal](18, 4) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[mrp試算] (
[內(nèi)部編號] [int] IDENTITY (1, 1) NOT NULL ,
[物料編號] [char] (14) NOT NULL ,
[年份] [int] NOT NULL ,
[計劃期] [int] NOT NULL ,
[期初庫存] [decimal](18, 4) NULL ,
[毛需求] [decimal](18, 4) NULL ,
[預(yù)計入庫] [decimal](18, 4) NULL ,
[預(yù)計出庫] [char] (10) NULL ,
[預(yù)計庫存] [decimal](18, 4) NULL ,
[凈需求] [decimal](18, 4) NULL ,
[計劃產(chǎn)出] [decimal](18, 4) NULL ,
[計劃投入] [decimal](18, 4) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[臨時生產(chǎn)件資源負(fù)荷報表] (
[資源編號] [char] (14) NOT NULL ,
[日期] [int] NULL ,
[年份] [int] NULL ,
[計劃期] [int] NULL ,
[負(fù)荷] [float] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[臨時資源負(fù)荷報表] (
[資源編號] [char] (14) NOT NULL ,
[日期] [int] NULL ,
[年份] [int] NULL ,
[計劃期] [int] NULL ,
[負(fù)荷] [float] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[臨時進(jìn)銷存卡片] (
[編號] [int] IDENTITY (1, 1) NOT NULL ,
[部門] [varchar] (20) NOT NULL ,
[組別] [varchar] (20) NOT NULL ,
[貨位] [varchar] (20) NULL ,
[貨號] [char] (14) NOT NULL ,
[批號] [varchar] (20) NOT NULL ,
[摘要] [varchar] (100) NOT NULL ,
[單據(jù)號] [char] (14) NOT NULL ,
[日期] [int] NULL ,
[入庫數(shù)量] [float] NOT NULL ,
[入庫金額] [float] NOT NULL ,
[出庫數(shù)量] [float] NOT NULL ,
[出庫金額] [float] NOT NULL ,
[結(jié)存數(shù)量] [float] NOT NULL ,
[結(jié)存金額] [float] NOT NULL ,
[同貨號數(shù)量] [float] NULL ,
[同貨號金額] [float] NULL ,
[成本單價] [float] NULL ,
[影響部門] [varchar] (20) NOT NULL ,
[影響組別] [varchar] (100) NOT NULL ,
[影響貨位] [varchar] (20) NULL ,
[接收登記] [binary] (30) NULL ,
[記帳人] [char] (20) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[主生產(chǎn)計劃] (
[內(nèi)部編號] [int] IDENTITY (1, 1) NOT NULL ,
[物料編號] [char] (14) NOT NULL ,
[編號] [char] (14) NULL ,
[年份] [int] NOT NULL ,
[計劃期] [int] NOT NULL ,
[開始日期] [int] NULL ,
[結(jié)束日期] [int] NULL ,
[期初庫存] [float] NULL ,
[需求數(shù)量] [float] NULL ,
[MPS數(shù)量] [float] NULL ,
[生產(chǎn)單數(shù)量] [float] NULL ,
[預(yù)計庫存] [float] NULL ,
[記帳人] [varchar] (10) NULL ,
[修改日期] [int] NULL ,
[修改標(biāo)記] [char] (1) NULL ,
[審核人] [varchar] (10) NULL ,
[審核日期] [int] NULL ,
[接收登記] [binary] (30) NULL ,
[狀態(tài)] [char] (10) NOT NULL Default '有效' ,
[備注] [varchar] (40) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[主生產(chǎn)計劃歷史] (
[內(nèi)部編號] [int] IDENTITY (1, 1) NOT NULL ,
[物料編號] [char] (14) NOT NULL ,
[編號] [char] (14) NULL ,
[年份] [int] NOT NULL ,
[計劃期] [int] NOT NULL ,
[開始日期] [int] NULL ,
[結(jié)束日期] [int] NULL ,
[期初庫存] [float] NULL ,
[需求數(shù)量] [float] NULL ,
[MPS數(shù)量] [float] NULL ,
[生產(chǎn)單數(shù)量] [float] NULL ,
[預(yù)計庫存] [float] NULL ,
[記帳人] [varchar] (10) NULL ,
[修改日期] [int] NULL ,
[修改標(biāo)記] [char] (1) NULL ,
[審核人] [varchar] (10) NULL ,
[審核日期] [int] NULL ,
[接收登記] [binary] (30) NULL ,
[狀態(tài)] [char] (10) NOT NULL ,
[備注] [varchar] (40) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[主生產(chǎn)計劃預(yù)排歷史] (
[內(nèi)部編號] [int] IDENTITY (1, 1) NOT NULL ,
[物料編號] [char] (14) NOT NULL ,
[編號] [char] (14) NULL ,
[年份] [int] NOT NULL ,
[計劃期] [int] NOT NULL ,
[開始日期] [int] NULL ,
[結(jié)束日期] [int] NULL ,
[期初庫存] [float] NULL ,
[需求數(shù)量] [float] NULL ,
[MPS數(shù)量] [float] NULL ,
[生產(chǎn)單數(shù)量] [float] NULL ,
[預(yù)計庫存] [float] NULL ,
[記帳人] [varchar] (10) NULL ,
[修改日期] [int] NULL ,
[修改標(biāo)記] [char] (1) NULL ,
[審核人] [varchar] (10) NULL ,
[審核日期] [int] NULL ,
[接收登記] [binary] (30) NULL ,
[狀態(tài)] [char] (10) NOT NULL ,
[備注] [varchar] (40) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[主需求計劃] (
[內(nèi)部編號] [int] IDENTITY (1, 1) NOT NULL ,
[編號] [char] (14) NULL ,
[物料編號] [char] (14) NOT NULL ,
[年份] [int] NOT NULL ,
[計劃期] [int] NOT NULL ,
[開始日期] [int] NULL ,
[結(jié)束日期] [int] NULL ,
[需求數(shù)量] [float] NULL ,
[記帳人] [varchar] (10) NULL ,
[修改日期] [int] NULL ,
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -