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


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



CREATE TABLE [oa_scheme] (
	[schemeid] [char] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[sc_name] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[userid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[ts] [datetime] NULL ,
	CONSTRAINT [PK_oa_scheme] PRIMARY KEY  CLUSTERED 
	(
		[schemeid]
	)  ON [PRIMARY] 
) ON [PRIMARY]



CREATE TABLE [oa_scheme_b] (
	[schemebid] [char] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[schemeid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[userid] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[ts] [datetime] NULL ,
	CONSTRAINT [PK_oa_scheme_b] PRIMARY KEY  CLUSTERED 
	(
		[schemebid]
	)  ON [PRIMARY] 
) ON [PRIMARY]
