

/****** Object:  Table [dbo].[syspara1]    Script Date: 2006-05-18 17:06:38 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[syspara1]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[syspara1]
GO

/****** Object:  Table [dbo].[account]    Script Date: 2006-05-18 17:06:38 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[account]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[account]
GO

/****** Object:  Table [dbo].[accountdetail]    Script Date: 2006-05-18 17:06:38 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[accountdetail]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[accountdetail]
GO

/****** Object:  Table [dbo].[accountno]    Script Date: 2006-05-18 17:06:38 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[accountno]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[accountno]
GO

/****** Object:  Table [dbo].[caipu]    Script Date: 2006-05-18 17:06:38 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[caipu]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[caipu]
GO

/****** Object:  Table [dbo].[codetable]    Script Date: 2006-05-18 17:06:38 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[codetable]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[codetable]
GO

/****** Object:  Table [dbo].[cylog]    Script Date: 2006-05-18 17:06:38 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[cylog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[cylog]
GO

/****** Object:  Table [dbo].[depositdetail]    Script Date: 2006-05-18 17:06:38 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[depositdetail]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[depositdetail]
GO

/****** Object:  Table [dbo].[dicttype]    Script Date: 2006-05-18 17:06:38 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[dicttype]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[dicttype]
GO

/****** Object:  Table [dbo].[lotcate]    Script Date: 2006-05-18 17:06:38 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[lotcate]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[lotcate]
GO

/****** Object:  Table [dbo].[operator]    Script Date: 2006-05-18 17:06:38 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[operator]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[operator]
GO

/****** Object:  Table [dbo].[opright]    Script Date: 2006-05-18 17:06:38 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[opright]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[opright]
GO

/****** Object:  Table [dbo].[options]    Script Date: 2006-05-18 17:06:38 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[options]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[options]
GO

/****** Object:  Table [dbo].[otherpara]    Script Date: 2006-05-18 17:06:38 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[otherpara]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[otherpara]
GO

/****** Object:  Table [dbo].[reserve]    Script Date: 2006-05-18 17:06:38 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[reserve]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[reserve]
GO

/****** Object:  Table [dbo].[stock]    Script Date: 2006-05-18 17:06:38 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[stock]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[stock]
GO

/****** Object:  Table [dbo].[stockiolog]    Script Date: 2006-05-18 17:06:38 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[stockiolog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[stockiolog]
GO

/****** Object:  Table [dbo].[susaccount]    Script Date: 2006-05-18 17:06:38 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[susaccount]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[susaccount]
GO

/****** Object:  Table [dbo].[syspara]    Script Date: 2006-05-18 17:06:38 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[syspara]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[syspara]
GO

/****** Object:  Table [dbo].[tableno]    Script Date: 2006-05-18 17:06:38 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tableno]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tableno]
GO

/****** Object:  Table [dbo].[tables]    Script Date: 2006-05-18 17:06:38 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tables]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tables]
GO

/****** Object:  User dbo    Script Date: 2006-05-18 17:06:37 ******/
/****** Object:  Table [dbo].[syspara1]    Script Date: 2006-05-18 17:06:39 ******/
CREATE TABLE [dbo].[syspara1] (
	[paratypecode] [varchar] (20) COLLATE Chinese_PRC_BIN NOT NULL ,
	[parasubtypecode] [varchar] (6) COLLATE Chinese_PRC_BIN NOT NULL ,
	[paracode] [varchar] (6) COLLATE Chinese_PRC_BIN NOT NULL ,
	[paradesc] [varchar] (100) COLLATE Chinese_PRC_BIN NULL ,
	[usedornot] [varchar] (1) COLLATE Chinese_PRC_BIN NULL ,
	[ext00] [varchar] (20) COLLATE Chinese_PRC_BIN NULL ,
	[ext01] [varchar] (4) COLLATE Chinese_PRC_BIN NULL ,
	[ext02] [varchar] (50) COLLATE Chinese_PRC_BIN NULL ,
	[ext03] [varchar] (10) COLLATE Chinese_PRC_BIN NULL ,
	[ext04] [varchar] (10) COLLATE Chinese_PRC_BIN NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[account]    Script Date: 2006-05-18 17:06:39 ******/
CREATE TABLE [dbo].[account] (
	[accountno] [varchar] (10) COLLATE Chinese_PRC_BIN NOT NULL ,
	[tableno] [varchar] (3) COLLATE Chinese_PRC_BIN NOT NULL ,
	[yscost] [numeric](18, 2) NOT NULL ,
	[servicecost] [numeric](18, 2) NOT NULL ,
	[othercost] [numeric](18, 2) NOT NULL ,
	[zhekou] [varchar] (2) COLLATE Chinese_PRC_BIN NOT NULL ,
	[sscost] [numeric](18, 2) NOT NULL ,
	[memberid] [varchar] (6) COLLATE Chinese_PRC_BIN NOT NULL ,
	[paytype] [varchar] (1) COLLATE Chinese_PRC_BIN NOT NULL ,
	[paycost] [numeric](18, 2) NOT NULL ,
	[paytype2] [varchar] (1) COLLATE Chinese_PRC_BIN NOT NULL ,
	[paycost2] [numeric](18, 2) NOT NULL ,
	[op_code_newbill] [varchar] (3) COLLATE Chinese_PRC_BIN NOT NULL ,
	[eatdate] [varchar] (8) COLLATE Chinese_PRC_BIN NOT NULL ,
	[eattime] [varchar] (4) COLLATE Chinese_PRC_BIN NOT NULL ,
	[accountdate] [varchar] (8) COLLATE Chinese_PRC_BIN NULL ,
	[accounttime] [varchar] (4) COLLATE Chinese_PRC_BIN NULL ,
	[personnum] [smallint] NOT NULL ,
	[s_code] [varchar] (3) COLLATE Chinese_PRC_BIN NOT NULL ,
	[guestname] [varchar] (30) COLLATE Chinese_PRC_BIN NOT NULL ,
	[isend] [varchar] (1) COLLATE Chinese_PRC_BIN NOT NULL ,
	[isdelete] [varchar] (1) COLLATE Chinese_PRC_BIN NOT NULL ,
	[deletedate] [varchar] (8) COLLATE Chinese_PRC_BIN NULL ,
	[deletetime] [varchar] (4) COLLATE Chinese_PRC_BIN NULL ,
	[op_code_delete] [varchar] (3) COLLATE Chinese_PRC_BIN NOT NULL ,
	[op_code_money] [varchar] (3) COLLATE Chinese_PRC_BIN NOT NULL ,
	[issuspend] [varchar] (1) COLLATE Chinese_PRC_BIN NOT NULL ,
	[suspendaccountno] [varchar] (6) COLLATE Chinese_PRC_BIN NOT NULL ,
	[invoice] [varchar] (1) COLLATE Chinese_PRC_BIN NULL ,
	[beizhu] [varchar] (30) COLLATE Chinese_PRC_BIN NOT NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[accountdetail]    Script Date: 2006-05-18 17:06:40 ******/
CREATE TABLE [dbo].[accountdetail] (
	[accountno] [varchar] (10) COLLATE Chinese_PRC_BIN NOT NULL ,
	[ccode] [varchar] (4) COLLATE Chinese_PRC_BIN NOT NULL ,
	[price] [numeric](18, 2) NOT NULL ,
	[costprice] [numeric](18, 2) NOT NULL ,
	[cnum] [numeric](18, 2) NOT NULL ,
	[yscost] [numeric](18, 2) NOT NULL ,
	[sscost] [numeric](18, 2) NOT NULL ,
	[eatdate] [varchar] (8) COLLATE Chinese_PRC_BIN NOT NULL ,
	[eattime] [varchar] (4) COLLATE Chinese_PRC_BIN NOT NULL ,
	[enddate] [varchar] (8) COLLATE Chinese_PRC_BIN NULL ,
	[endtime] [varchar] (4) COLLATE Chinese_PRC_BIN NULL ,
	[ctype] [varchar] (2) COLLATE Chinese_PRC_BIN NOT NULL ,
	[isdelete] [varchar] (1) COLLATE Chinese_PRC_BIN NOT NULL ,
	[op_delete] [varchar] (3) COLLATE Chinese_PRC_BIN NULL ,
	[reason_delete] [varchar] (30) COLLATE Chinese_PRC_BIN NULL ,
	[taste] [varchar] (20) COLLATE Chinese_PRC_BIN NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[accountno]    Script Date: 2006-05-18 17:06:40 ******/
CREATE TABLE [dbo].[accountno] (
	[playdate] [varchar] (9) COLLATE Chinese_PRC_BIN NOT NULL ,
	[accountno] [varchar] (6) COLLATE Chinese_PRC_BIN NOT NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[caipu]    Script Date: 2006-05-18 17:06:40 ******/
CREATE TABLE [dbo].[caipu] (
	[cname] [varchar] (50) COLLATE Chinese_PRC_BIN NOT NULL ,
	[ccode] [varchar] (6) COLLATE Chinese_PRC_BIN NOT NULL ,
	[cpinyin] [varchar] (20) COLLATE Chinese_PRC_BIN NOT NULL ,
	[isusable] [varchar] (1) COLLATE Chinese_PRC_BIN NOT NULL ,
	[menutype] [varchar] (2) COLLATE Chinese_PRC_BIN NOT NULL ,
	[sapor] [varchar] (2) COLLATE Chinese_PRC_BIN NOT NULL ,
	[stattype] [varchar] (2) COLLATE Chinese_PRC_BIN NOT NULL ,
	[price] [numeric](18, 2) NOT NULL ,
	[isrebate] [varchar] (2) COLLATE Chinese_PRC_BIN NOT NULL ,
	[weight] [numeric](18, 2) NOT NULL ,
	[unit] [varchar] (2) COLLATE Chinese_PRC_BIN NOT NULL ,
	[datelastedit] [varchar] (30) COLLATE Chinese_PRC_BIN NOT NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[codetable]    Script Date: 2006-05-18 17:06:41 ******/
CREATE TABLE [dbo].[codetable] (
	[mytype] [tinyint] NOT NULL ,
	[mycode] [varchar] (1) COLLATE Chinese_PRC_BIN NOT NULL ,
	[mydesc] [varchar] (50) COLLATE Chinese_PRC_BIN NOT NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[cylog]    Script Date: 2006-05-18 17:06:41 ******/
CREATE TABLE [dbo].[cylog] (
	[logdate] [varchar] (8) COLLATE Chinese_PRC_BIN NULL ,
	[logtime] [varchar] (4) COLLATE Chinese_PRC_BIN NULL ,
	[functionid] [varchar] (3) COLLATE Chinese_PRC_BIN NULL ,
	[operatorid] [varchar] (3) COLLATE Chinese_PRC_BIN NULL ,
	[logcontent] [varchar] (200) COLLATE Chinese_PRC_BIN NULL ,
	[logid] [varchar] (14) COLLATE Chinese_PRC_BIN NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[depositdetail]    Script Date: 2006-05-18 17:06:41 ******/
CREATE TABLE [dbo].[depositdetail] (
	[flowno] [varchar] (14) COLLATE Chinese_PRC_BIN NOT NULL ,
	[accountno] [varchar] (6) COLLATE Chinese_PRC_BIN NOT NULL ,
	[actionid] [varchar] (1) COLLATE Chinese_PRC_BIN NOT NULL ,
	[deposit] [numeric](18, 2) NOT NULL ,
	[operatorid] [varchar] (4) COLLATE Chinese_PRC_BIN NOT NULL ,
	[actiondate] [varchar] (8) COLLATE Chinese_PRC_BIN NOT NULL ,
	[actiontime] [varchar] (4) COLLATE Chinese_PRC_BIN NOT NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[dicttype]    Script Date: 2006-05-18 17:06:42 ******/
CREATE TABLE [dbo].[dicttype] (
	[dicttype] [tinyint] NOT NULL ,
	[dicttypedesc] [varchar] (100) COLLATE Chinese_PRC_BIN NOT NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[lotcate]    Script Date: 2006-05-18 17:06:42 ******/
CREATE TABLE [dbo].[lotcate] (
	[cateno] [varchar] (4) COLLATE Chinese_PRC_BIN NOT NULL ,
	[ccode] [varchar] (4) COLLATE Chinese_PRC_BIN NOT NULL ,
	[cnum] [float] NOT NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[operator]    Script Date: 2006-05-18 17:06:42 ******/
CREATE TABLE [dbo].[operator] (
	[op_code] [varchar] (3) COLLATE Chinese_PRC_BIN NOT NULL ,
	[op_name] [varchar] (10) COLLATE Chinese_PRC_BIN NOT NULL ,
	[op_pass] [varchar] (10) COLLATE Chinese_PRC_BIN NOT NULL ,
	[sex] [varchar] (1) COLLATE Chinese_PRC_BIN NOT NULL ,
	[workstart] [varchar] (8) COLLATE Chinese_PRC_BIN NULL ,
	[address] [varchar] (30) COLLATE Chinese_PRC_BIN NULL ,
	[personid] [varchar] (18) COLLATE Chinese_PRC_BIN NOT NULL ,
	[optype] [varchar] (2) COLLATE Chinese_PRC_BIN NOT NULL ,
	[isuse] [varchar] (1) COLLATE Chinese_PRC_BIN NOT NULL ,
	[comment] [varchar] (100) COLLATE Chinese_PRC_BIN NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[opright]    Script Date: 2006-05-18 17:06:42 ******/
CREATE TABLE [dbo].[opright] (
	[optype] [varchar] (2) COLLATE Chinese_PRC_BIN NOT NULL ,
	[moduleno] [varchar] (2) COLLATE Chinese_PRC_BIN NOT NULL ,
	[haveright] [varchar] (1) COLLATE Chinese_PRC_BIN NOT NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[options]    Script Date: 2006-05-18 17:06:43 ******/
CREATE TABLE [dbo].[options] (
	[optionvalue] [bit] NOT NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[otherpara]    Script Date: 2006-05-18 17:06:43 ******/
CREATE TABLE [dbo].[otherpara] (
	[dicttype] [tinyint] NOT NULL ,
	[sortno] [varchar] (3) COLLATE Chinese_PRC_BIN NOT NULL ,
	[itemno] [varchar] (20) COLLATE Chinese_PRC_BIN NOT NULL ,
	[itemdesc] [varchar] (100) COLLATE Chinese_PRC_BIN NOT NULL ,
	[itemvalue] [varchar] (100) COLLATE Chinese_PRC_BIN NOT NULL ,
	[flag] [varchar] (1) COLLATE Chinese_PRC_BIN NOT NULL ,
	[columnorder] [varchar] (2) COLLATE Chinese_PRC_BIN NOT NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[reserve]    Script Date: 2006-05-18 17:06:43 ******/
CREATE TABLE [dbo].[reserve] (
	[reserveno] [varchar] (10) COLLATE Chinese_PRC_BIN NOT NULL ,
	[tableno] [varchar] (3) COLLATE Chinese_PRC_BIN NOT NULL ,
	[guestname] [varchar] (10) COLLATE Chinese_PRC_BIN NOT NULL ,
	[arrivedate] [varchar] (8) COLLATE Chinese_PRC_BIN NOT NULL ,
	[arrivetime] [varchar] (4) COLLATE Chinese_PRC_BIN NOT NULL ,
	[personnum] [varchar] (3) COLLATE Chinese_PRC_BIN NOT NULL ,
	[eatmoney] [numeric](10, 2) NOT NULL ,
	[reserveclass] [varchar] (2) COLLATE Chinese_PRC_BIN NOT NULL ,
	[comment] [varchar] (100) COLLATE Chinese_PRC_BIN NOT NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[stock]    Script Date: 2006-05-18 17:06:43 ******/
CREATE TABLE [dbo].[stock] (
	[ccode] [varchar] (6) COLLATE Chinese_PRC_BIN NOT NULL ,
	[ctype] [varchar] (1) COLLATE Chinese_PRC_BIN NOT NULL ,
	[costprice] [numeric](18, 2) NOT NULL ,
	[stocks] [numeric](18, 2) NOT NULL ,
	[cost] [numeric](18, 2) NOT NULL ,
	[alertdate] [varchar] (8) COLLATE Chinese_PRC_BIN NULL ,
	[minimum] [numeric](18, 2) NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[stockiolog]    Script Date: 2006-05-18 17:06:44 ******/
CREATE TABLE [dbo].[stockiolog] (
	[stockinid] [varchar] (12) COLLATE Chinese_PRC_BIN NOT NULL ,
	[actionid] [varchar] (1) COLLATE Chinese_PRC_BIN NULL ,
	[ccode] [varchar] (6) COLLATE Chinese_PRC_BIN NOT NULL ,
	[numberin] [numeric](18, 2) NOT NULL ,
	[price] [numeric](18, 2) NOT NULL ,
	[cost] [numeric](18, 2) NULL ,
	[indate] [varchar] (8) COLLATE Chinese_PRC_BIN NOT NULL ,
	[intime] [varchar] (4) COLLATE Chinese_PRC_BIN NOT NULL ,
	[operatorid] [varchar] (4) COLLATE Chinese_PRC_BIN NOT NULL ,
	[beizhu] [varchar] (50) COLLATE Chinese_PRC_BIN NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[susaccount]    Script Date: 2006-05-18 17:06:44 ******/
CREATE TABLE [dbo].[susaccount] (
	[accountno] [varchar] (6) COLLATE Chinese_PRC_BIN NOT NULL ,
	[unitname] [varchar] (20) COLLATE Chinese_PRC_BIN NOT NULL ,
	[unitphone] [varchar] (20) COLLATE Chinese_PRC_BIN NOT NULL ,
	[unitclass] [varchar] (2) COLLATE Chinese_PRC_BIN NOT NULL ,
	[isusable] [varchar] (1) COLLATE Chinese_PRC_BIN NOT NULL ,
	[comment] [varchar] (100) COLLATE Chinese_PRC_BIN NOT NULL ,
	[summoney] [numeric](18, 2) NOT NULL ,
	[sumtimes] [int] NOT NULL ,
	[summoneypaid] [numeric](18, 2) NOT NULL ,
	[sumtimespaid] [int] NOT NULL ,
	[deposit] [decimal](18, 2) NOT NULL ,
	[depositused] [decimal](18, 2) NOT NULL ,
	[remarks] [bigint] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[syspara]    Script Date: 2006-05-18 17:06:44 ******/
CREATE TABLE [dbo].[syspara] (
	[paratypecode] [varchar] (20) COLLATE Chinese_PRC_BIN NOT NULL ,
	[paracode] [varchar] (6) COLLATE Chinese_PRC_BIN NOT NULL ,
	[paradesc] [varchar] (100) COLLATE Chinese_PRC_BIN NOT NULL ,
	[usedornot] [varchar] (1) COLLATE Chinese_PRC_BIN NOT NULL ,
	[ext00] [varchar] (20) COLLATE Chinese_PRC_BIN NOT NULL ,
	[ext01] [varchar] (4) COLLATE Chinese_PRC_BIN NOT NULL ,
	[ext02] [varchar] (50) COLLATE Chinese_PRC_BIN NOT NULL ,
	[ext03] [varchar] (10) COLLATE Chinese_PRC_BIN NOT NULL ,
	[ext04] [varchar] (10) COLLATE Chinese_PRC_BIN NOT NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[tableno]    Script Date: 2006-05-18 17:06:45 ******/
CREATE TABLE [dbo].[tableno] (
	[tableno] [varchar] (4) COLLATE Chinese_PRC_BIN NOT NULL ,
	[tablename] [varchar] (10) COLLATE Chinese_PRC_BIN NOT NULL ,
	[tabletype] [varchar] (1) COLLATE Chinese_PRC_BIN NOT NULL ,
	[tablestate] [varchar] (1) COLLATE Chinese_PRC_BIN NOT NULL ,
	[accountno] [varchar] (10) COLLATE Chinese_PRC_BIN NOT NULL ,
	[seatnum] [tinyint] NOT NULL ,
	[waitercode] [varchar] (3) COLLATE Chinese_PRC_BIN NOT NULL ,
	[settletime] [varchar] (10) COLLATE Chinese_PRC_BIN NOT NULL ,
	[guest] [varchar] (10) COLLATE Chinese_PRC_BIN NOT NULL ,
	[operator] [varchar] (4) COLLATE Chinese_PRC_BIN NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[tables]    Script Date: 2006-05-18 17:06:45 ******/
CREATE TABLE [dbo].[tables] (
	[tablename] [varchar] (15) COLLATE Chinese_PRC_BIN NOT NULL ,
	[tabledesc] [varchar] (10) COLLATE Chinese_PRC_BIN NOT NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[syspara1] WITH NOCHECK ADD 
	CONSTRAINT [PK_syspara1] PRIMARY KEY  CLUSTERED 
	(
		[paratypecode],
		[parasubtypecode],
		[paracode]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[caipu] WITH NOCHECK ADD 
	CONSTRAINT [PK_caipu] PRIMARY KEY  CLUSTERED 
	(
		[ccode]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[operator] WITH NOCHECK ADD 
	CONSTRAINT [PK_operator] PRIMARY KEY  CLUSTERED 
	(
		[op_code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[reserve] WITH NOCHECK ADD 
	CONSTRAINT [PK_reserve] PRIMARY KEY  CLUSTERED 
	(
		[reserveno]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[stock] WITH NOCHECK ADD 
	CONSTRAINT [PK_stock] PRIMARY KEY  CLUSTERED 
	(
		[ccode]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[susaccount] WITH NOCHECK ADD 
	CONSTRAINT [PK_susaccount] PRIMARY KEY  CLUSTERED 
	(
		[accountno]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[tableno] WITH NOCHECK ADD 
	CONSTRAINT [PK_tableno] PRIMARY KEY  CLUSTERED 
	(
		[tableno]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[syspara1] WITH NOCHECK ADD 
	CONSTRAINT [DF_syspara1_paradesc] DEFAULT (0) FOR [paradesc],
	CONSTRAINT [DF_syspara1_usedornot] DEFAULT (0) FOR [usedornot],
	CONSTRAINT [DF_syspara1_ext00] DEFAULT (0) FOR [ext00],
	CONSTRAINT [DF_syspara1_ext01] DEFAULT (0) FOR [ext01],
	CONSTRAINT [DF_syspara1_ext02] DEFAULT (0) FOR [ext02],
	CONSTRAINT [DF_syspara1_ext03] DEFAULT (0) FOR [ext03],
	CONSTRAINT [DF_syspara1_ext04] DEFAULT (0) FOR [ext04]
GO

ALTER TABLE [dbo].[account] WITH NOCHECK ADD 
	CONSTRAINT [DF_account_yscost] DEFAULT (0) FOR [yscost],
	CONSTRAINT [DF_account_servicecost] DEFAULT (0) FOR [servicecost],
	CONSTRAINT [DF_account_othercost] DEFAULT (0) FOR [othercost],
	CONSTRAINT [DF_account_zhekou] DEFAULT (0) FOR [zhekou],
	CONSTRAINT [DF_account_sscost] DEFAULT (0) FOR [sscost],
	CONSTRAINT [DF_account_memberid] DEFAULT ('') FOR [memberid],
	CONSTRAINT [DF_account_paytype] DEFAULT (0) FOR [paytype],
	CONSTRAINT [DF_account_paycost] DEFAULT (0) FOR [paycost],
	CONSTRAINT [DF_account_paytype2] DEFAULT (0) FOR [paytype2],
	CONSTRAINT [DF_account_paycost2] DEFAULT (0) FOR [paycost2],
	CONSTRAINT [DF_account_op_code_newbill] DEFAULT (0) FOR [op_code_newbill],
	CONSTRAINT [DF_account_eatdate] DEFAULT (0) FOR [eatdate],
	CONSTRAINT [DF_account_eattime] DEFAULT (0) FOR [eattime],
	CONSTRAINT [DF_account_accountdate] DEFAULT (0) FOR [accountdate],
	CONSTRAINT [DF_account_accounttime] DEFAULT (0) FOR [accounttime],
	CONSTRAINT [DF_account_personnum] DEFAULT (0) FOR [personnum],
	CONSTRAINT [DF_account_s_code] DEFAULT (0) FOR [s_code],
	CONSTRAINT [DF_account_guestname] DEFAULT (0) FOR [guestname],
	CONSTRAINT [DF_account_isend] DEFAULT (0) FOR [isend],
	CONSTRAINT [DF_account_isdelete] DEFAULT (0) FOR [isdelete],
	CONSTRAINT [DF_account_deletedate] DEFAULT (0) FOR [deletedate],
	CONSTRAINT [DF_account_deletetime] DEFAULT (0) FOR [deletetime],
	CONSTRAINT [DF_account_op_code_delete] DEFAULT (0) FOR [op_code_delete],
	CONSTRAINT [DF_account_op_code_money] DEFAULT (0) FOR [op_code_money],
	CONSTRAINT [DF_account_issuspend] DEFAULT (0) FOR [issuspend],
	CONSTRAINT [DF_account_suspendaccountno] DEFAULT (0) FOR [suspendaccountno],
	CONSTRAINT [DF_account_invoice] DEFAULT (0) FOR [invoice],
	CONSTRAINT [DF_account_beizhu] DEFAULT (0) FOR [beizhu]
GO

ALTER TABLE [dbo].[accountdetail] WITH NOCHECK ADD 
	CONSTRAINT [DF_accountdetail_costprice] DEFAULT (0) FOR [costprice],
	CONSTRAINT [DF_accountdetail_cnum] DEFAULT (0) FOR [cnum],
	CONSTRAINT [DF_accountdetail_yscost] DEFAULT (0) FOR [yscost],
	CONSTRAINT [DF_accountdetail_sscost] DEFAULT (0) FOR [sscost],
	CONSTRAINT [DF_accountdetail_eatdate] DEFAULT (0) FOR [eatdate],
	CONSTRAINT [DF_accountdetail_eattime] DEFAULT (0) FOR [eattime],
	CONSTRAINT [DF_accountdetail_ctype] DEFAULT (0) FOR [ctype],
	CONSTRAINT [DF_accountdetail_isdelete] DEFAULT (0) FOR [isdelete],
	CONSTRAINT [DF_accountdetail_taste] DEFAULT (0) FOR [taste]
GO

ALTER TABLE [dbo].[caipu] WITH NOCHECK ADD 
	CONSTRAINT [DF_caipu_cname] DEFAULT (0) FOR [cname],
	CONSTRAINT [DF_caipu_ccode] DEFAULT (0) FOR [ccode],
	CONSTRAINT [DF_caipu_isusable] DEFAULT (0) FOR [isusable],
	CONSTRAINT [DF_caipu_menutype] DEFAULT (0) FOR [menutype],
	CONSTRAINT [DF_caipu_sapor] DEFAULT (0) FOR [sapor],
	CONSTRAINT [DF_caipu_stattype] DEFAULT (0) FOR [stattype],
	CONSTRAINT [DF_caipu_price] DEFAULT (0) FOR [price],
	CONSTRAINT [DF_caipu_isrebate] DEFAULT (0) FOR [isrebate],
	CONSTRAINT [DF_caipu_weight] DEFAULT (0) FOR [weight],
	CONSTRAINT [DF_caipu_unit] DEFAULT (0) FOR [unit],
	CONSTRAINT [DF_caipu_datelastedit] DEFAULT (0) FOR [datelastedit],
	CONSTRAINT [IX_caipu] UNIQUE  NONCLUSTERED 
	(
		[cname]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[depositdetail] WITH NOCHECK ADD 
	CONSTRAINT [DF_depositdetail_flowno] DEFAULT (0) FOR [flowno]
GO

ALTER TABLE [dbo].[operator] WITH NOCHECK ADD 
	CONSTRAINT [DF_operator_op_pass] DEFAULT ('!/#!') FOR [op_pass],
	CONSTRAINT [DF_operator_sex] DEFAULT (0) FOR [sex],
	CONSTRAINT [DF_operator_personid] DEFAULT (0) FOR [personid],
	CONSTRAINT [DF_operator_optype] DEFAULT (0) FOR [optype],
	CONSTRAINT [DF_operator_isuse] DEFAULT (0) FOR [isuse],
	CONSTRAINT [DF_operator_comment] DEFAULT (0) FOR [comment],
	CONSTRAINT [IX_operator] UNIQUE  NONCLUSTERED 
	(
		[op_name]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[opright] WITH NOCHECK ADD 
	CONSTRAINT [DF_opright_moduleno] DEFAULT (0) FOR [moduleno],
	CONSTRAINT [DF_opright_haveright] DEFAULT (0) FOR [haveright]
GO

ALTER TABLE [dbo].[reserve] WITH NOCHECK ADD 
	CONSTRAINT [DF_reserve_comment] DEFAULT (0) FOR [comment]
GO

ALTER TABLE [dbo].[stock] WITH NOCHECK ADD 
	CONSTRAINT [DF_stock_ctype] DEFAULT (0) FOR [ctype],
	CONSTRAINT [DF_stock_costprice] DEFAULT (0) FOR [costprice],
	CONSTRAINT [DF_stock_stocks] DEFAULT (0) FOR [stocks],
	CONSTRAINT [DF_stock_cost] DEFAULT (0) FOR [cost],
	CONSTRAINT [DF_stock_alertdate] DEFAULT (0) FOR [alertdate],
	CONSTRAINT [DF_stock_minimum] DEFAULT (0) FOR [minimum]
GO

ALTER TABLE [dbo].[susaccount] WITH NOCHECK ADD 
	CONSTRAINT [DF_susaccount_isusable] DEFAULT (1) FOR [isusable],
	CONSTRAINT [DF_susaccount_comment] DEFAULT (0) FOR [comment],
	CONSTRAINT [DF_susaccount_summoney] DEFAULT (0) FOR [summoney],
	CONSTRAINT [DF_susaccount_sumtimes] DEFAULT (0) FOR [sumtimes],
	CONSTRAINT [DF_susaccount_summoneypaid] DEFAULT (0) FOR [summoneypaid],
	CONSTRAINT [DF_susaccount_sumtimespaid] DEFAULT (0) FOR [sumtimespaid],
	CONSTRAINT [DF_susaccount_deposit] DEFAULT (0) FOR [deposit],
	CONSTRAINT [DF_susaccount_depositused] DEFAULT (0) FOR [depositused],
	CONSTRAINT [IX_susaccount] UNIQUE  NONCLUSTERED 
	(
		[unitname]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[syspara] WITH NOCHECK ADD 
	CONSTRAINT [DF_syspara_ext00] DEFAULT (0) FOR [ext00],
	CONSTRAINT [DF_syspara_ext01] DEFAULT (0) FOR [ext01],
	CONSTRAINT [DF_syspara_ext02] DEFAULT (0) FOR [ext02],
	CONSTRAINT [DF_syspara_ext03] DEFAULT (0) FOR [ext03],
	CONSTRAINT [DF_syspara_ext04] DEFAULT (0) FOR [ext04]
GO

ALTER TABLE [dbo].[tableno] WITH NOCHECK ADD 
	CONSTRAINT [DF_tableno_tabletype] DEFAULT (0) FOR [tabletype],
	CONSTRAINT [DF_tableno_tablestate] DEFAULT (0) FOR [tablestate],
	CONSTRAINT [DF_tableno_accountno] DEFAULT (0) FOR [accountno],
	CONSTRAINT [DF_tableno_seatnum] DEFAULT (0) FOR [seatnum],
	CONSTRAINT [DF_tableno_waitercode] DEFAULT (0) FOR [waitercode],
	CONSTRAINT [DF_tableno_settletime] DEFAULT (0) FOR [settletime],
	CONSTRAINT [DF_tableno_guest] DEFAULT (0) FOR [guest],
	CONSTRAINT [IX_tableno] UNIQUE  NONCLUSTERED 
	(
		[tablename]
	)  ON [PRIMARY] 
GO

