⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dstr_fd.sql

📁 用友U8财务软件VB源程序, 本版本为2002年版本
💻 SQL
📖 第 1 页 / 共 5 页
字号:
	create table fd_accsum (
	CAccID               nvarchar(50)         not null,
	dbill_date           datetime             not null,
	mb                   money                null,
	mh                   money                null,
	mcde                 money                null,
	mcdeh                money                null,
	mb_cad               money                null,
	mh_cad               money                null,
	mcde_cad             money                null,
	mcdeh_cad            money                null,
	constraint PK_FD_ACCSUM primary key  (CAccID, dbill_date)
	)
go


if exists (select 1
            from  sysindexes
           where  id    = object_id('fd_entities')
            and   name  = 'ix_fd_entities'
            and   indid > 0
            and   indid < 255)
   drop index fd_entities.ix_fd_entities
go


if not exists (select 1 from  sysobjects where  id = object_id('fd_entities') and type = 'U')
	create table fd_entities (
	iID                  smallint             not null,
	sName                varchar(50)          not null,
	sCaption             nvarchar(50)         not null,
	iBIType              smallint             not null,
	sMaxOID              char(15)             not null,
	sSourceTable         varchar(50)          not null,
	sOIDSourceField      varchar(30)          not null,
	iParentID            smallint             null,
	sParentField         varchar(30)          null,
	sTaskID              varchar(10)          null,
	sHelpContextID       varchar(10)          null,
	sDescription         fd_udt_digest        null,
	iSheet               int                  null,
	iRows                int                  null,
	iCols                int                  null,
	iWidth               dec(24,2)            null,
	iHeight              dec(24,2)            null,
	sPzSign              varchar(8)           null,
	iIsUsed              tinyint              null,
	iVchType             tinyint              null,
	iDeriveBIType        smallint             null default 0,
	bIsAutoAlarm         bit                  null,
	iAlarmDays           int                  null,
	constraint PK_FD_ENTITIES primary key  (iID)
	)
go


create unique  index ix_fd_entities on fd_entities (
iBIType,
iID
)
go


if not exists (select 1 from  sysobjects where  id = object_id('fd_f1file') and   type = 'U')
	create table fd_f1file (
	f1file_id            fd_udt_id            not null,
	size_num             int                  not null,
	contents             image                null,
	constraint PK_FD_F1FILE primary key  (f1file_id)
	)
go


if exists (select 1
            from  sysindexes
           where  id    = object_id('fd_fields')
            and   name  = 'ix_fd_fields'
            and   indid > 0
            and   indid < 255)
   drop index fd_fields.ix_fd_fields
go


if not exists (select 1 from  sysobjects where  id = object_id('fd_fields') and type = 'U')
	create table fd_fields (
	iID                  int                  not null,
	sName                varchar(50)          not null,
	sCaption             nvarchar(60)         not null,
	sSourceField         varchar(50)          null,
	iEntityID            smallint             not null,
	iFieldOption         tinyint              not null,
	bPersistent          bit                  not null,
	bIsUsed              bit                  not null,
	sHelpContextID       varchar(10)          null,
	sTaskID              varchar(10)          null,
	iEditProp            tinyint              not null,
	iDataType            tinyint              not null,
	iReferenceType       smallint             not null,
	iRefFldSqc           smallint             null,
	iQryFldsqc           smallint             null,
	iLength              smallint             not null,
	iDecimals            tinyint              null,
	bAllowNull           bit                  not null,
	sDefaultValue        fd_udt_digest        null,
	iRow                 int                  null,
	iStartCol            int                  null,
	iInputCol            int                  null,
	iEndCol              int                  null,
	dblLeft              float                null,
	dblWidth             float                null,
	dblInputLeft         float                null,
	dblInputWidth        float                null,
	dblTop               float                null,
	dblHeight            float                null,
	dblMin               money                null,
	dblMax               money                null,
	constraint PK_FD_FIELDS primary key  (iID)
	)
go


create unique  index ix_fd_fields on fd_fields (
iEntityID,
iID
)
go


if exists (select 1
            from  sysindexes
           where  id    = object_id('fd_locks')
            and   name  = 'ix_fd_locks'
            and   indid > 0
            and   indid < 255)
   drop index fd_locks.ix_fd_locks
go


if not exists (select 1 from  sysobjects where  id = object_id('fd_locks') and   type = 'U')
	create table fd_locks (
	locks_id             fd_udt_id            not null,
	user_name            nvarchar(50)         not null,
	workstation_name     nvarchar(255)        not null,
	class_flag           tinyint              null,
	digest               fd_udt_digest        null,
	constraint PK_FD_LOCKS primary key  (locks_id)
	)
go


create   index ix_fd_locks on fd_locks (
workstation_name,
user_name
)
go


if exists (select 1
            from  sysindexes
           where  id    = object_id('fd_option')
            and   name  = 'ix_fd_option'
            and   indid > 0
            and   indid < 255)
   drop index fd_option.ix_fd_option
go


if exists (select 1 from  sysobjects where  id = object_id('fd_option') and type = 'U')
	begin
	if COLUMNPROPERTY( OBJECT_ID('fd_option'),'Aldays','AllowsNull') = 1
		alter table fd_option alter column Aldays smallint not null
	if COLUMNPROPERTY( OBJECT_ID('fd_option'),'schedule_flag','AllowsNull') is null
		alter table fd_option add schedule_flag bit null
	if COLUMNPROPERTY( OBJECT_ID('fd_option'),'dzdorder_flag','AllowsNull') is null
		alter table fd_option add dzdorder_flag tinyint null
	if COLUMNPROPERTY( OBJECT_ID('fd_option'),'lxdzero_flag','AllowsNull') is null
		alter table fd_option add lxdzero_flag bit null
	if COLUMNPROPERTY( OBJECT_ID('fd_option'),'lxdnegative_flag','AllowsNull') is null
		alter table fd_option add lxdnegative_flag bit null
	if COLUMNPROPERTY( OBJECT_ID('fd_option'),'lxddelay_num','AllowsNull') is null
		alter table fd_option add lxddelay_num smallint null
	if COLUMNPROPERTY( OBJECT_ID('fd_option'),'autoreturn_flag','AllowsNull') is null
		alter table fd_option add autoreturn_flag bit null
	if COLUMNPROPERTY( OBJECT_ID('fd_option'),'returnorder_lev','AllowsNull') is null
		alter table fd_option add returnorder_lev char(3) null
	if COLUMNPROPERTY( OBJECT_ID('fd_option'),'limitloan_flag','AllowsNull') is null
		alter table fd_option add limitloan_flag bit null
	if COLUMNPROPERTY( OBJECT_ID('fd_option'),'reply_num','AllowsNull') is null
		alter table fd_option add reply_num smallint null
	end
go


if OBJECTPROPERTY ( OBJECT_ID('fd_option'),'TableHasPrimaryKey') = 0
	alter table fd_option add constraint PK_FD_OPTION primary key  (Aldays)


if not exists (select 1 from  sysobjects where  id = object_id('fd_option') and type = 'U')
	create table fd_option (
	Alarm                bit                  not null,
	Aldays               smallint             not null,
	schedule_flag        bit                  null,
	Option1              datetime             null,
	dzdrows              smallint             null,
	dzdorder_flag        tinyint              null,
	lxdzero_flag         bit                  null,
	lxdnegative_flag     bit                  null,
	lxddelay_num         smallint             null,
	autoreturn_flag      bit                  null,
	returnorder_lev      char(3)              null,
	limitloan_flag       bit                  null,
	reply_num	     smallint             null,
	option2              bit                  null,
	option3              varchar(60)          null,
	constraint PK_FD_OPTION primary key  (Aldays)
	)
go


if not exists (select 1 from  sysobjects where  id = object_id('fd_query_b') and type = 'U')
	create table fd_query_b (
	query_b_id           fd_udt_id            not null,
	query_id             fd_udt_id            not null,
	fields_id            int                  not null,
	l_parenthesis        char(1)              null,
	comparison_opr       varchar(50)          not null,
	comparison_value     varchar(50)          not null,
	r_parenthesis        char(1)              null,
	relation_opr         varchar(5)           null,
	constraint PK_FD_QUERY_B primary key  (query_id, query_b_id)
	)
go


if exists (select 1
            from  sysindexes
           where  id    = object_id('fd_query_h')
            and   name  = 'ix_fd_query_name'
            and   indid > 0
            and   indid < 255)
   drop index fd_query_h.ix_fd_query_name
go


if exists (select 1
            from  sysindexes
           where  id    = object_id('fd_query_h')
            and   name  = 'ix_fd_query_id'
            and   indid > 0
            and   indid < 255)
   drop index fd_query_h.ix_fd_query_id
go


if not exists (select 1 from  sysobjects  where id = object_id('fd_query_h') and   type = 'U')
	create table fd_query_h (
	query_id             fd_udt_id            not null,
	query_name           nvarchar(80)         not null,
	type_flag            smallint             not null,
	sqlclause            text                 null,
	orderby              varchar(255)         null,
	constraint PK_FD_QUERY_H primary key  (query_id)
	)
go


create unique  index ix_fd_query_name on fd_query_h (
type_flag,
query_name
)
go


create unique  index ix_fd_query_id on fd_query_h (
type_flag,
query_id
)
go


if exists (select 1
            from  sysindexes
           where  id    = object_id('fd_settle')
            and   name  = 'ix_fd_settle_code'
            and   indid > 0
            and   indid < 255)
   drop index fd_settle.ix_fd_settle_code
go


if not exists (select 1 from  sysobjects where  id = object_id('fd_settle') and type = 'U')
	create table fd_settle (
	settle_id            fd_udt_id            not null,
	settle_code          varchar(10)          not null,
	charge_flag          tinyint              null,
	constraint PK_FD_SETTLE primary key  (settle_id)
	)
go


create unique  index ix_fd_settle_code on fd_settle (
settle_code
)
go


if exists (select 1
            from  sysindexes
           where  id    = object_id('fd_settle_b')
            and   name  = 'ix_fd_settle_b'
            and   indid > 0
            and   indid < 255)
   drop index fd_settle_b.ix_fd_settle_b
go


if not exists (select 1 from  sysobjects where  id = object_id('fd_settle_b') and type = 'U')
	create table fd_settle_b (
	settle_b_id          fd_udt_id            not null,
	settle_id            fd_udt_id            not null,
	money_name           nvarchar(8)          null,
	unitprice_mny        money                null,
	limit_mny            money                null,
	digest               fd_udt_digest        null,
	constraint PK_FD_SETTLE_B primary key  (settle_b_id)
	)
go


create unique  index ix_fd_settle_b on fd_settle_b (
settle_id,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -