SCO供应链协同

## 数据表：T_SPM_PROMOTIONAPPLYORG（促销申请组织范围）

### T_SPM_PROMOTIONAPPLYORG（促销申请组织范围）：描述

名称 | T_SPM_PROMOTIONAPPLYORG（促销申请组织范围）
代码 | T_SPM_PROMOTIONAPPLYORG
注释 | 促销申请组织范围
模型 | SCO供应链协同
主键 | PK_SPM_PROMOTIONAPPLYORG

### T_SPM_PROMOTIONAPPLYORG（促销申请组织范围）：列规格定义

名称 | 代码 | 数据类型 | 长度 | 强制 | 注释
单据FID | FID | int |  | TRUE |
分录内码 | FENTRYORGID | int |  | TRUE |
序号 | FSEQ | int |  | TRUE |
参与促销组织 | FPARTAKEORGID | int |  | TRUE |
部门 | FPROMOTIONDEPTID | int |  | TRUE |
预计销售收入 | FEXPECTACHIVEMENT | decimal(23,10) | 23 | TRUE |
预计费用 | FEXPECTAMOUNT | decimal[23,10] | 23 | TRUE |
促销开始日期 | FPROMOTIONSTARTDATE | datetime |  | FALSE |
促销结束日期 | FPROMOTIONENDDATE | datetime |  | FALSE |

### T_SPM_PROMOTIONAPPLYORG（促销申请组织范围）：脚本代码

if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('T_SPM_PROMOTIONAPPLYORG') and o.name = 'FK_T_SPM_PR_R_SPM_PRO_T_SPM_PR')
alter table T_SPM_PROMOTIONAPPLYORG
drop constraint FK_T_SPM_PR_R_SPM_PRO_T_SPM_PR
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('T_SPM_PROMOTIONAPPLYORG_L') and o.name = 'FK_T_SPM_PR_R_SPM_PRO_T_SPM_PR')
alter table T_SPM_PROMOTIONAPPLYORG_L
drop constraint FK_T_SPM_PR_R_SPM_PRO_T_SPM_PR
go
if exists (select 1
from sysindexes
where id = object_id('T_SPM_PROMOTIONAPPLYORG')
and name = 'IDX_SPM_PROMOAPPEO_ORGID'
and indid > 0
and indid < 255)
drop index T_SPM_PROMOTIONAPPLYORG.IDX_SPM_PROMOAPPEO_ORGID
go
if exists (select 1
from sysindexes
where id = object_id('T_SPM_PROMOTIONAPPLYORG')
and name = 'IDX_SPM_PROMOAPPEO_FID'
and indid > 0
and indid < 255)
drop index T_SPM_PROMOTIONAPPLYORG.IDX_SPM_PROMOAPPEO_FID
go
if exists (select 1
from sysobjects
where id = object_id('T_SPM_PROMOTIONAPPLYORG')
and type = 'U')
drop table T_SPM_PROMOTIONAPPLYORG
go
/*==============================================================*/
/* Table: T_SPM_PROMOTIONAPPLYORG */
/*==============================================================*/
create table T_SPM_PROMOTIONAPPLYORG (
FID int not null default 0,
FENTRYORGID int not null default 0,
FSEQ int not null default 0,
FPARTAKEORGID int not null default 0,
FPROMOTIONDEPTID int not null default 0,
FEXPECTACHIVEMENT decimal(23,10) not null default 0.00,
FEXPECTAMOUNT decimal[23,10] not null default '0.00',
FPROMOTIONSTARTDATE datetime null,
FPROMOTIONENDDATE datetime null,
constraint PK_SPM_PROMOTIONAPPLYORG primary key (FENTRYORGID)
)
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'促销申请组织范围',
'user', @CurrentUser, 'table', 'T_SPM_PROMOTIONAPPLYORG'
go
/*==============================================================*/
/* Index: IDX_SPM_PROMOAPPEO_FID */
/*==============================================================*/
create index IDX_SPM_PROMOAPPEO_FID on T_SPM_PROMOTIONAPPLYORG (
FID ASC
)
go
/*==============================================================*/
/* Index: IDX_SPM_PROMOAPPEO_ORGID */
/*==============================================================*/
create index IDX_SPM_PROMOAPPEO_ORGID on T_SPM_PROMOTIONAPPLYORG (
FPARTAKEORGID ASC,
FPROMOTIONSTARTDATE ASC,
FPROMOTIONENDDATE ASC,
FID ASC
)
go
alter table T_SPM_PROMOTIONAPPLYORG
add constraint FK_T_SPM_PR_R_SPM_PRO_T_SPM_PR foreign key (FID)
references T_SPM_PROMOTIONAPPLY (FID)
go

### T_SPM_PROMOTIONAPPLYORG（促销申请组织范围）：键值定义

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

### T_SPM_PROMOTIONAPPLYORG（促销申请组织范围）：索引定义

名称 | 代码 | 唯一的 | 群集器 | 主要的 | 外键 | 候选键 | 表格
IDX_SPM_PROMOAPPEO_FID | IDX_SPM_PROMOAPPEO_FID | FALSE | FALSE | FALSE | FALSE | FALSE | T_SPM_PROMOTIONAPPLYORG（促销申请组织范围）
IDX_SPM_PROMOAPPEO_ORGID | IDX_SPM_PROMOAPPEO_ORGID | FALSE | FALSE | FALSE | FALSE | FALSE | T_SPM_PROMOTIONAPPLYORG（促销申请组织范围）

上一页

主页

下一页