if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ht_dhys]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ht_dhys]


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ht_fj]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ht_fj]


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ht_gzr]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ht_gzr]


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ht_htbasedoc]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ht_htbasedoc]


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ht_htbd]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ht_htbd]


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ht_htbg]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ht_htbg]


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ht_jsjh]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ht_jsjh]


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ht_jsqk]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ht_jsqk]


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ht_zxqk]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ht_zxqk]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[mail_b]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[mail_b]


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[mail_fj]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[mail_fj]


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[mail_h]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[mail_h]

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[oa_news]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[oa_news]


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[oa_news_fj]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[oa_news_fj]


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[oa_news_pn]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[oa_news_pn]

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[oa_flow_file]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[oa_flow_file]

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[oa_xfwj]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[oa_xfwj]


CREATE TABLE [oa_flow_file] (
	[fileid] [char] (32) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[templateid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[flowdirid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_name] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_size] [int] NULL ,
	[userid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[deptid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[corpid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[oprflag] [smallint] NULL ,
	[wj_date] [datetime] NULL ,
	[curr_spr] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[curr_date] [datetime] NULL ,
	[print_num] [int] NULL ,
	[sourceid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[pf_spr] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[pf_js] [smallint] NULL ,
	[sj_date] [datetime] NULL ,
	[sj_flag] [smallint] NULL ,
	[sj_ry] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[sj_yj] [nvarchar] (300) COLLATE Chinese_PRC_CI_AS NULL ,
	[wjhjid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_wh] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[wjmjid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[wjtypeid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_key] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_fwdw] [nvarchar] (60) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_fwbm] [nvarchar] (60) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_ngr] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_qfr] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_shdate] [datetime] NULL ,
	[wj_bjsx] [datetime] NULL ,
	[wj_dyfs] [smallint] NULL ,
	[wj_sourcetype] [smallint] NULL ,
	[wj_gdnote] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_gdr] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_gdrid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_gddate] [datetime] NULL ,
	[wj_swbh] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[swlbid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_gdajh] [char] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_lfdw] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_zsdw] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_csdw] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_fsdw] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_bz] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_fwh] [char] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[file_path] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[file_key] [char] (40) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_oldflag] [smallint] NULL ,
	[wj_bjdate] [datetime] NULL ,
	[wj_useddays] [smallint] NULL ,
	[wj_dbflag] [smallint] NULL ,
	[ts] [datetime] NULL ,
	CONSTRAINT [PK_oa_flow_file] PRIMARY KEY  CLUSTERED 
	(
		[fileid]
	)  ON [PRIMARY] 
) ON [PRIMARY]




CREATE TABLE [oa_xfwj] (
	[xfwjid] [char] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[wjtypeid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[wjhjid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[wjmjid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_name] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_wh] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_key] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_fwdw] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_fwbm] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_ngr] [char] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_qfr] [char] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_sourcetype] [smallint] NULL ,
	[wj_sourceid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[oprflag] [smallint] NULL ,
	[wj_gddate] [datetime] NULL ,
	[wj_gdrid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_gdr] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_date] [datetime] NULL ,
	[userid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[deptid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_zfbz] [smallint] NULL ,
	[wj_zfzs] [smallint] NULL ,
	[ts] [datetime] NULL ,
	[fc] [smallint] NULL ,
	[wj_xwlb] [smallint] NULL ,
	[fwdeptid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_gdajh] [char] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_gdnote] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_lfdw] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_zsdw] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_csdw] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_fsdw] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_bz] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[wj_oldflag] [smallint] NULL ,
	[hzflag] [smallint] NULL ,
	CONSTRAINT [PK_oa_xfwj] PRIMARY KEY  CLUSTERED 
	(
		[xfwjid]
	)  ON [PRIMARY] 
) ON [PRIMARY]



CREATE TABLE [mail_b] (
	[pk_mail] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[pk_mailb] [char] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[mail_getopr] [char] (40) COLLATE Chinese_PRC_CI_AS NULL ,
	[mail_read] [smallint] NULL ,
	[mail_dele] [smallint] NULL ,
	[mail_readdate] [datetime] NULL ,
	CONSTRAINT [PK_mail_b] PRIMARY KEY  CLUSTERED 
	(
		[pk_mailb]
	)  ON [PRIMARY] 
) ON [PRIMARY]



CREATE TABLE [mail_fj] (
	[pk_mail] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[pk_fj] [char] (30) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[fj_type] [char] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[fj_name] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[fj_path] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[fj_size] [int] NULL ,
	[nrow] [smallint] NULL ,
	[pwd] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[fj_sourceid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	CONSTRAINT [PK_mail_fj] PRIMARY KEY  CLUSTERED 
	(
		[pk_fj]
	)  ON [PRIMARY] 
) ON [PRIMARY]



CREATE TABLE [mail_h] (
	[pk_mail] [char] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[mail_head] [char] (400) COLLATE Chinese_PRC_CI_AS NULL ,
	[mail_note] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[mail_sendopr] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[mail_date] [datetime] NULL ,
	[mail_ip] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[mail_dele] [smallint] NULL ,
	[mail_size] [int] NULL ,
	CONSTRAINT [PK_mail_h] PRIMARY KEY  CLUSTERED 
	(
		[pk_mail]
	)  ON [PRIMARY] 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]



CREATE TABLE [oa_news] (
	[newsid] [char] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[news_date] [datetime] NULL ,
	[news_head] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[news_text] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[news_ip] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[userid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[deptid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[corpid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[funcid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[fc] [smallint] NULL ,
	[dr] [smallint] NULL ,
	[ts] [datetime] NULL ,
	[news_reads] [int] NULL ,
	[istop] [smallint] NULL ,
	[fileid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[oprflag] [smallint] NULL ,
	[news_key] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[news_zy] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[fbflag] [smallint] NULL ,
	CONSTRAINT [PK_oa_news] PRIMARY KEY  CLUSTERED 
	(
		[newsid]
	)  ON [PRIMARY] 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]



CREATE TABLE [oa_news_fj] (
	[fjid] [char] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[newsid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[fj_type] [char] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[fj_name] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[fj_path] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[nrow] [smallint] NULL ,
	[ts] [datetime] NULL ,
	[fj_size] [int] NULL ,
	[pwd] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[fj_sourceid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	CONSTRAINT [PK_oa_news_fj] PRIMARY KEY  CLUSTERED 
	(
		[fjid]
	)  ON [PRIMARY] 
) ON [PRIMARY]



CREATE TABLE [oa_news_pn] (
	[pnid] [char] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[newsid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[userid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[pn_text] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[ts] [datetime] NULL ,
	CONSTRAINT [PK_oa_news_pn] PRIMARY KEY  CLUSTERED 
	(
		[pnid]
	)  ON [PRIMARY] 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]



CREATE TABLE [ht_dhys] (
	[pk_htbasedoc] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[pk_dhys] [char] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[dh_date] [datetime] NULL ,
	[pk_htbd] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[dh_note] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[dh_sl] [money] NULL ,
	[dh_dj] [money] NULL ,
	[dh_je] [money] NULL ,
	[nrow] [smallint] NULL ,
	[locked] [smallint] NULL ,
	[dh_sfr] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[dh_mc] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[dh_gg] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[dh_xh] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[dh_dfdw] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[dh_dfsfr] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[ts] [datetime] NULL ,
	[dh_dw] [char] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	CONSTRAINT [PK_ht_dhys] PRIMARY KEY  CLUSTERED 
	(
		[pk_dhys]
	)  ON [PRIMARY] 
) ON [PRIMARY]



CREATE TABLE [ht_fj] (
	[mainid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[fjid] [char] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[fj_type] [char] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[fj_rowpk] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[fj_name] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[fj_path] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[fj_size] [int] NULL ,
	[fj_flag] [smallint] NULL ,
	[nrow] [smallint] NULL ,
	[locked] [smallint] NULL ,
	[pwd] [char] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[ts] [datetime] NULL ,
	[fj_sourceid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[fj_sourcetype] [smallint] NULL ,
	CONSTRAINT [PK_ht_fj] PRIMARY KEY  CLUSTERED 
	(
		[fjid]
	)  ON [PRIMARY] 
) ON [PRIMARY]



CREATE TABLE [ht_gzr] (
	[pk_htgzr] [varchar] (40) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[pk_htbasedoc] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[userid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	CONSTRAINT [PK_ht_gzr] PRIMARY KEY  CLUSTERED 
	(
		[pk_htgzr]
	)  ON [PRIMARY] 
) ON [PRIMARY]



CREATE TABLE [ht_htbasedoc] (
	[pk_htbasedoc] [char] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[httypeid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[busimodeid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[paymodeid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[custdocid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[ht_code] [char] (40) COLLATE Chinese_PRC_CI_AS NULL ,
	[ht_name] [nvarchar] (60) COLLATE Chinese_PRC_CI_AS NULL ,
	[ht_money] [money] NULL ,
	[ht_dfdsr] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[ht_dfjzr] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[ht_cbbm] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[ht_cbr] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[ht_jzr] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[ht_start_date] [datetime] NULL ,
	[ht_end_date] [datetime] NULL ,
	[ht_jd_date] [datetime] NULL ,
	[ht_jd_addr] [nvarchar] (40) COLLATE Chinese_PRC_CI_AS NULL ,
	[ht_property] [smallint] NULL ,
	[ht_mainpk] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[ht_mainname] [nvarchar] (60) COLLATE Chinese_PRC_CI_AS NULL ,
	[ht_end] [smallint] NULL ,
	[ht_lrr] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[locked] [smallint] NULL ,
	[ht_lxqx] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[ht_sj_enddate] [datetime] NULL ,
	[ht_gzr] [char] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[ht_jsr] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[ht_yjgdflag] [smallint] NULL ,
	[ht_yjgdr] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[ht_yjgdsj] [datetime] NULL ,
	[ht_yjgdbz] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[ts] [datetime] NULL ,
	[source_id] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[source_code] [char] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[corpid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[deptid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[userid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[ht_jsmoney] [money] NULL ,
	[ht_wjsmoney] [money] NULL ,
	[ht_yjfs] [smallint] NULL ,
	[ht_jetype] [smallint] NULL ,
	CONSTRAINT [PK_ht_htbasedoc] PRIMARY KEY  CLUSTERED 
	(
		[pk_htbasedoc]
	)  ON [PRIMARY] 
) ON [PRIMARY]



CREATE TABLE [ht_htbd] (
	[pk_htbasedoc] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[pk_htbd] [char] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[bd_jhrq] [datetime] NULL ,
	[bd_cpmc] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[bd_cpgg] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[bd_cpxh] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[bd_cpdw] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[bd_cpsl] [money] NULL ,
	[bd_cpdj] [money] NULL ,
	[bd_cpje] [money] NULL ,
	[nrow] [smallint] NULL ,
	[locked] [smallint] NULL ,
	[ts] [datetime] NULL ,
	[bd_note] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	CONSTRAINT [PK_ht_htbd] PRIMARY KEY  CLUSTERED 
	(
		[pk_htbd]
	)  ON [PRIMARY] 
) ON [PRIMARY]



CREATE TABLE [ht_htbg] (
	[pk_htbasedoc] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[pk_htbg] [char] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[bg_date] [datetime] NULL ,
	[bg_yy] [nvarchar] (400) COLLATE Chinese_PRC_CI_AS NULL ,
	[bg_note] [nvarchar] (400) COLLATE Chinese_PRC_CI_AS NULL ,
	[bg_yj] [nvarchar] (400) COLLATE Chinese_PRC_CI_AS NULL ,
	[bg_lx] [char] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[bg_cbr] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[bg_pzr] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[nrow] [smallint] NULL ,
	[locked] [smallint] NULL ,
	[ts] [datetime] NULL ,
	CONSTRAINT [PK_ht_htbg] PRIMARY KEY  CLUSTERED 
	(
		[pk_htbg]
	)  ON [PRIMARY] 
) ON [PRIMARY]



CREATE TABLE [ht_jsjh] (
	[pk_htbasedoc] [char] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[pk_jsjh] [char] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[jh_date] [datetime] NULL ,
	[jh_note] [nvarchar] (600) COLLATE Chinese_PRC_CI_AS NULL ,
	[jh_jsje] [money] NULL ,
	[jh_jsbl] [money] NULL ,
	[paymodeid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[nrow] [smallint] NULL ,
	[locked] [smallint] NULL ,
	[jh_sjjsje] [money] NULL ,
	[ts] [datetime] NULL ,
	CONSTRAINT [PK_ht_jsjh] PRIMARY KEY  CLUSTERED 
	(
		[pk_jsjh]
	)  ON [PRIMARY] 
) ON [PRIMARY]



CREATE TABLE [ht_jsqk] (
	[pk_htbasedoc] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[pk_jsqk] [char] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[js_date] [datetime] NULL ,
	[js_note] [nvarchar] (600) COLLATE Chinese_PRC_CI_AS NULL ,
	[js_cbr] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[js_dfcbr] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[js_money] [money] NULL ,
	[pk_jsjh] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[nrow] [smallint] NULL ,
	[locked] [smallint] NULL ,
	[paymodeid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[ts] [datetime] NULL ,
	CONSTRAINT [PK_ht_jsqk] PRIMARY KEY  CLUSTERED 
	(
		[pk_jsqk]
	)  ON [PRIMARY] 
) ON [PRIMARY]



CREATE TABLE [ht_zxqk] (
	[pk_htbasedoc] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[pk_zxqk] [char] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[zx_date] [datetime] NULL ,
	[zx_note] [nvarchar] (600) COLLATE Chinese_PRC_CI_AS NULL ,
	[zx_sfyc] [char] (2) COLLATE Chinese_PRC_CI_AS NULL ,
	[zx_ycsm] [nvarchar] (600) COLLATE Chinese_PRC_CI_AS NULL ,
	[zx_wcjt] [money] NULL ,
	[nrow] [smallint] NULL ,
	[locked] [smallint] NULL ,
	[ts] [datetime] NULL ,
	[zx_htend] [smallint] NULL ,
	CONSTRAINT [PK_ht_zxqk] PRIMARY KEY  CLUSTERED 
	(
		[pk_zxqk]
	)  ON [PRIMARY] 
) ON [PRIMARY]



    
