SCO供应链协同

## 数据表：T_SPM_PROMOTIONCOUNT(促销政策促销累计统计表)

### T_SPM_PROMOTIONCOUNT(促销政策促销累计统计表)：描述

名称 | T_SPM_PROMOTIONCOUNT(促销政策促销累计统计表)
代码 | T_SPM_PROMOTIONCOUNT
注释 |
模型 | SCO供应链协同
主键 | PK_SPM_PROMOTIONCOUNT

### T_SPM_PROMOTIONCOUNT(促销政策促销累计统计表)：列规格定义

名称 | 代码 | 数据类型 | 长度 | 强制 | 注释
主键 | FID | int |  | TRUE |
单据编号 | FBILLNO | nvarchar(50) | 50 | TRUE |
销售组织 | FSALEORGID | int |  | TRUE |
币别 | FCURRENCYID | int |  | TRUE |
客户分类 | FCUSTOMERTYPEID | varchar(36) | 36 | TRUE |
客户ID | FCUSTOMERID | int |  | TRUE |
客户分配内码 | FCUSTMASTERID | int |  | TRUE |
促销政策ID | FSPPOLICYID | int |  | TRUE |
促销开始时间 | FSTARTTIME | datetime |  | FALSE |
促销结束时间 | FENDTIME | datetime |  | FALSE |
初始累计开始时间 | FCOUNTSTARTTIME | datetime |  | FALSE |
初始累计结束时间 | FCOUNTENDTIME | datetime |  | FALSE |
是否补赠 | FISGIVEUP | char(1) | 1 | TRUE |
创建人 | FCREATORID | int |  | TRUE |
创建日期 | FCREATEDATE | datetime |  | FALSE |
修改人 | FMODIFIERID | int |  | TRUE |
修改日期 | FMODIFYDATE | datetime |  | FALSE |
数据来源 | FDATASOURCE | varchar(30) | 30 | TRUE | CP_SaleOrder：网上订单 SAL_OutStock：销售出库单 Manual：人工填写
统计时间 | FCOUNTTIME | datetime |  | TRUE |
单据状态 | FDOCUMENTSTATUS | char(1) | 1 | TRUE |
促销政策参与组织分录ID | FSALEORGENTRYID | int |  | TRUE |
促销政策参与客户分录ID | FCUSTOMERENTRYID | int |  | TRUE |

### T_SPM_PROMOTIONCOUNT(促销政策促销累计统计表)：脚本代码

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_PROMOTIONCOUNTENTRY') and o.name = 'FK_T_SPM_PR_REFERENCE_T_SPM_PR')
alter table T_SPM_PROMOTIONCOUNTENTRY
drop constraint FK_T_SPM_PR_REFERENCE_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_PROMOTIONCOUNTGROUP') and o.name = 'FK_T_SPM_PR_REFERENCE_T_SPM_PR')
alter table T_SPM_PROMOTIONCOUNTGROUP
drop constraint FK_T_SPM_PR_REFERENCE_T_SPM_PR
go
if exists (select 1
from sysindexes
where id = object_id('T_SPM_PROMOTIONCOUNT')
and name = 'IDX_SPM_PROMOTIONCOUNT_PID'
and indid > 0
and indid < 255)
drop index T_SPM_PROMOTIONCOUNT.IDX_SPM_PROMOTIONCOUNT_PID
go
if exists (select 1
from sysindexes
where id = object_id('T_SPM_PROMOTIONCOUNT')
and name = 'IDX_SPM_PROMOTIONCOUNT_C'
and indid > 0
and indid < 255)
drop index T_SPM_PROMOTIONCOUNT.IDX_SPM_PROMOTIONCOUNT_C
go
if exists (select 1
from sysindexes
where id = object_id('T_SPM_PROMOTIONCOUNT')
and name = 'IDX_SPM_PROMOTIONCOUNT_T'
and indid > 0
and indid < 255)
drop index T_SPM_PROMOTIONCOUNT.IDX_SPM_PROMOTIONCOUNT_T
go
if exists (select 1
from sysobjects
where id = object_id('T_SPM_PROMOTIONCOUNT')
and type = 'U')
drop table T_SPM_PROMOTIONCOUNT
go
/*==============================================================*/
/* Table: T_SPM_PROMOTIONCOUNT */
/*==============================================================*/
create table T_SPM_PROMOTIONCOUNT (
FID int not null default 0,
FBILLNO nvarchar(50) not null default '',
FSALEORGID int not null default 0,
FCURRENCYID int not null default 0,
FCUSTOMERTYPEID varchar(36) not null default '',
FCUSTOMERID int not null default 0,
FCUSTMASTERID int not null default 0,
FSPPOLICYID int not null default 0,
FSTARTTIME datetime null,
FENDTIME datetime null,
FCOUNTSTARTTIME datetime null,
FCOUNTENDTIME datetime null,
FISGIVEUP char(1) not null default '',
FCREATORID int not null default 0,
FCREATEDATE datetime null,
FMODIFIERID int not null default 0,
FMODIFYDATE datetime null,
FDATASOURCE varchar(30) not null default '',
FCOUNTTIME datetime not null default getdate(),
FDOCUMENTSTATUS char(1) not null default '',
FSALEORGENTRYID int not null default 0,
FCUSTOMERENTRYID int not null default 0,
constraint PK_SPM_PROMOTIONCOUNT primary key (FID)
)
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'CP_SaleOrder：网上订单
SAL_OutStock：销售出库单
Manual：人工填写',
'user', @CurrentUser, 'table', 'T_SPM_PROMOTIONCOUNT', 'column', 'FDATASOURCE'
go
/*==============================================================*/
/* Index: IDX_SPM_PROMOTIONCOUNT_T */
/*==============================================================*/
create index IDX_SPM_PROMOTIONCOUNT_T on T_SPM_PROMOTIONCOUNT (
FSTARTTIME ASC,
FENDTIME ASC,
FCUSTMASTERID ASC,
FSALEORGID ASC,
FCUSTOMERTYPEID ASC,
FSPPOLICYID ASC
)
go
/*==============================================================*/
/* Index: IDX_SPM_PROMOTIONCOUNT_C */
/*==============================================================*/
create index IDX_SPM_PROMOTIONCOUNT_C on T_SPM_PROMOTIONCOUNT (
FSALEORGID ASC,
FCUSTMASTERID ASC,
FSTARTTIME ASC,
FENDTIME ASC,
FCUSTOMERTYPEID ASC
)
go
/*==============================================================*/
/* Index: IDX_SPM_PROMOTIONCOUNT_PID */
/*==============================================================*/
create index IDX_SPM_PROMOTIONCOUNT_PID on T_SPM_PROMOTIONCOUNT (
FSPPOLICYID ASC,
FCUSTOMERENTRYID ASC,
FSALEORGENTRYID ASC,
FID ASC
)
go

### T_SPM_PROMOTIONCOUNT(促销政策促销累计统计表)：键值定义

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

### T_SPM_PROMOTIONCOUNT(促销政策促销累计统计表)：索引定义

名称 | 代码 | 唯一的 | 群集器 | 主要的 | 外键 | 候选键 | 表格
IDX_SPM_PROMOTIONCOUNT_T | IDX_SPM_PROMOTIONCOUNT_T | FALSE | FALSE | FALSE | FALSE | FALSE | T_SPM_PROMOTIONCOUNT(促销政策促销累计统计表)
IDX_SPM_PROMOTIONCOUNT_C | IDX_SPM_PROMOTIONCOUNT_C | FALSE | FALSE | FALSE | FALSE | FALSE | T_SPM_PROMOTIONCOUNT(促销政策促销累计统计表)
IDX_SPM_PROMOTIONCOUNT_PID | IDX_SPM_PROMOTIONCOUNT_PID | FALSE | FALSE | FALSE | FALSE | FALSE | T_SPM_PROMOTIONCOUNT(促销政策促销累计统计表)

上一页

主页

下一页