MFG制造

### T_SP_PICKMTRLDATA(简单生产领料单物料明细)：脚本代码

if exists (select 1
from sysindexes
where id = object_id('T_SP_PICKMTRLDATA')
and name = 'IDX_SP_PMD_FID'
and indid > 0
and indid < 255)
drop index T_SP_PICKMTRLDATA.IDX_SP_PMD_FID
go
if exists (select 1
from sysindexes
where id = object_id('T_SP_PICKMTRLDATA')
and name = 'IDX_SP_PMD_MTRLID'
and indid > 0
and indid < 255)
drop index T_SP_PICKMTRLDATA.IDX_SP_PMD_MTRLID
go
if exists (select 1
from sysindexes
where id = object_id('T_SP_PICKMTRLDATA')
and name = 'IDX_SP_PMD_SRCLINK'
and indid > 0
and indid < 255)
drop index T_SP_PICKMTRLDATA.IDX_SP_PMD_SRCLINK
go
if exists (select 1
from sysobjects
where id = object_id('T_SP_PICKMTRLDATA')
and type = 'U')
drop table T_SP_PICKMTRLDATA
go
/*==============================================================*/
/* Table: T_SP_PICKMTRLDATA */
/*==============================================================*/
create table T_SP_PICKMTRLDATA (
FID int null,
FENTRYID int not null default 0,
FSEQ int null,
FMATERIALID int null,
FUNITID int null,
FSELPRCDRETURNQTY decimal(23,10) not null default 0,
FAPPQTY decimal(23,10) not null default 0,
FACTUALQTY decimal(23,10) not null default 0,
FBASEUNITID int null,
FBASESELPRCDRETURNQTY decimal(23,10) not null default 0,
FBASEAPPQTY decimal(23,10) not null default 0,
FBASEACTUALQTY decimal(23,10) not null default 0,
FSTOCKUNITID int null,
FSTOCKSELPRCDRETURNQTY decimal(23,10) not null default 0,
FSTOCKACTUALQTY decimal(23,10) not null default 0,
FSECUNITID int null,
FSECSELPRCDRETURNQTY decimal(23,10) not null default 0,
FSECACTUALQTY decimal(23,10) not null default 0,
FEXTAUXUNITID int not null default 0,
FEXTAUXUNITQTY decimal(23,10) not null default 0,
FSTOCKID int null,
FWORKSHOPID int null,
FSTOCKLOCID int null,
FSTOCKSTATUSID int null,
FSTOCKFLAG char(1) null,
FPRODUCEDATE datetime null,
FEXPIRYDATE datetime null,
FBOMID int null,
FMTONO nvarchar(255) null,
FLOT int null,
FLOT_TEXT nvarchar(255) null,
FAUXPROPID int null,
FPRICE decimal(19,6) not null default 0,
FAMOUNT decimal(19,6) not null default 0,
FSRCBILLTYPE varchar(36) null,
FSRCINTERID int null,
FSRCENTRYID int null,
FSRCBILLNO nvarchar(80) null,
FSRCENTRYSEQ int null,
FKEEPERTYPEID varchar(36) null,
FKEEPERID int null,
FOWNERTYPEID varchar(36) null,
FOWNERID int null,
FPARENTOWNERTYPEID varchar(36) null,
FPARENTOWNERID int null,
FPRODUCTNO nvarchar(80) null,
FPRODUCTID int not null default 0,
FSNUNITID int not null default 0,
FSNQTY int not null default 0,
FISAFFECTCOST char(1) not null default '0',
FPRODUCTGROUPID int not null default 0,
FISCONSUMESUM char(1) not null default '',
constraint PK_SP_PICKMTRLDATA primary key (FENTRYID)
)
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'和供应链保持一致，表体冗余',
'user', @CurrentUser, 'table', 'T_SP_PICKMTRLDATA', 'column', 'FOWNERTYPEID'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'和供应链保持一致，表体冗余',
'user', @CurrentUser, 'table', 'T_SP_PICKMTRLDATA', 'column', 'FOWNERID'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'成本领域使用',
'user', @CurrentUser, 'table', 'T_SP_PICKMTRLDATA', 'column', 'FPRODUCTNO'
go
/*==============================================================*/
/* Index: IDX_SP_PMD_SRCLINK */
/*==============================================================*/
create index IDX_SP_PMD_SRCLINK on T_SP_PICKMTRLDATA (
FSRCBILLTYPE ASC,
FSRCINTERID ASC,
FSRCENTRYID ASC
)
go
/*==============================================================*/
/* Index: IDX_SP_PMD_MTRLID */
/*==============================================================*/
create index IDX_SP_PMD_MTRLID on T_SP_PICKMTRLDATA (
FMATERIALID ASC
)
go
/*==============================================================*/
/* Index: IDX_SP_PMD_FID */
/*==============================================================*/
create index IDX_SP_PMD_FID on T_SP_PICKMTRLDATA (
FID ASC
)
go

### T_SP_PICKMTRLDATA(简单生产领料单物料明细)：键值定义

名称 | 代码 | 主要的
PK_SP_PICKMTRLDATA | PK_SP_PICKMTRLDATA | TRUE

### T_SP_PICKMTRLDATA(简单生产领料单物料明细)：索引定义

名称 | 代码 | 唯一的 | 群集器 | 主要的 | 外键 | 候选键 | 表格
IDX_SP_PMD_SRCLINK | IDX_SP_PMD_SRCLINK | FALSE | FALSE | FALSE | FALSE | FALSE | T_SP_PICKMTRLDATA(简单生产领料单物料明细)
IDX_SP_PMD_MTRLID | IDX_SP_PMD_MTRLID | FALSE | FALSE | FALSE | FALSE | FALSE | T_SP_PICKMTRLDATA(简单生产领料单物料明细)
IDX_SP_PMD_FID | IDX_SP_PMD_FID | FALSE | FALSE | FALSE | FALSE | FALSE | T_SP_PICKMTRLDATA(简单生产领料单物料明细)

上一页

主页

下一页