集团财务

## 数据表：T_CR_Scope(合并范围)

### T_CR_Scope(合并范围)：描述

名称 | T_CR_Scope(合并范围)
代码 | T_CR_Scope
注释 | 合并范围
模型 | 集团财务
主键 | PK_CR_SCOPE

### T_CR_Scope(合并范围)：列规格定义

名称 | 代码 | 数据类型 | 长度 | 强制 | 注释
内码 | FEntryId | int |  | TRUE |
合并方案(FVersionGroupID) | FID | int |  | TRUE |
编码 | FNUMBER | nvarchar(30) | 30 | TRUE |
数据状态 | FDOCUMENTSTATUS | char(1) | 1 | TRUE | Z暂存，A创建，B审核中，C已审核，D重新审核
序号 | FSeq | int |  | TRUE |
上级合并范围ID | FPARENTID | int |  | TRUE |
合并方法 | FConsolidationMode | char(1) | 1 | TRUE |

### T_CR_Scope(合并范围)：脚本代码

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_CR_Company') and o.name = 'FK_T_CR_COM_REFERENCE_T_CR_SCO')
alter table T_CR_Company
drop constraint FK_T_CR_COM_REFERENCE_T_CR_SCO
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_CR_Scope') and o.name = 'FK_T_CR_SCO_REFERENCE_T_CR_SCO')
alter table T_CR_Scope
drop constraint FK_T_CR_SCO_REFERENCE_T_CR_SCO
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_CR_Scope_L') and o.name = 'FK_T_CR_SCO_REFERENCE_T_CR_SCO')
alter table T_CR_Scope_L
drop constraint FK_T_CR_SCO_REFERENCE_T_CR_SCO
go
if exists (select 1
from sysindexes
where id = object_id('T_CR_Scope')
and name = 'IDX_CR_Scope_FID'
and indid > 0
and indid < 255)
drop index T_CR_Scope.IDX_CR_Scope_FID
go
if exists (select 1
from sysindexes
where id = object_id('T_CR_Scope')
and name = 'IDX_CR_Scope_FNumber'
and indid > 0
and indid < 255)
drop index T_CR_Scope.IDX_CR_Scope_FNumber
go
if exists (select 1
from sysobjects
where id = object_id('T_CR_Scope')
and type = 'U')
drop table T_CR_Scope
go
/*==============================================================*/
/* Table: T_CR_Scope */
/*==============================================================*/
create table T_CR_Scope (
FEntryId int not null default 0,
FID int not null default 0,
FNUMBER nvarchar(30) not null default ' ',
FDOCUMENTSTATUS char(1) not null default ' ',
FSeq int not null default 0,
FPARENTID int not null default 0,
FConsolidationMode char(1) not null default '0',
constraint PK_CR_SCOPE primary key (FEntryId)
)
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'合并范围',
'user', @CurrentUser, 'table', 'T_CR_Scope'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'Z暂存，A创建，B审核中，C已审核，D重新审核',
'user', @CurrentUser, 'table', 'T_CR_Scope', 'column', 'FDOCUMENTSTATUS'
go
/*==============================================================*/
/* Index: IDX_CR_Scope_FNumber */
/*==============================================================*/
create index IDX_CR_Scope_FNumber on T_CR_Scope (
FNUMBER ASC
)
go
/*==============================================================*/
/* Index: IDX_CR_Scope_FID */
/*==============================================================*/
create index IDX_CR_Scope_FID on T_CR_Scope (
FID ASC
)
go
alter table T_CR_Scope
add constraint FK_T_CR_SCO_REFERENCE_T_CR_SCO foreign key (FID)
references T_CR_ScopeType (FID)
go

### T_CR_Scope(合并范围)：键值定义

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

### T_CR_Scope(合并范围)：索引定义

名称 | 代码 | 唯一的 | 群集器 | 主要的 | 外键 | 候选键 | 表格
IDX_CR_Scope_FNumber | IDX_CR_Scope_FNumber | FALSE | FALSE | FALSE | FALSE | FALSE | T_CR_Scope(合并范围)
IDX_CR_Scope_FID | IDX_CR_Scope_FID | FALSE | FALSE | FALSE | FALSE | FALSE | T_CR_Scope(合并范围)

上一页

主页

下一页