IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'N25175_hj') 
 DROP DATABASE [N25175_hj] 
 GO 
CREATE DATABASE [N25175_hj]  ON (NAME = N'N25175_hj_Data', FILENAME = N'd:\Program Files\Microsoft SQL Server\MSSQL\data\N25175_hj_Data.MDF' , SIZE = 2, FILEGROWTH = 10%) LOG ON (NAME = 
N'N25175_hj_Log', FILENAME = N'd:\Program Files\Microsoft SQL Server\MSSQL\data\N25175_hj_Log.LDF' , SIZE = 1, FILEGROWTH = 10%) 
COLLATE Chinese_PRC_CI_AS 
GO 
exec sp_dboption N'N25175_hj', N'autoclose', N'true' 
GO exec sp_dboption N'N25175_hj', N'bulkcopy', N'false' 
GO 
exec sp_dboption N'N25175_hj', N'trunc. log', N'true' 
GO 
exec sp_dboption N'N25175_hj', N'torn page detection', N'true' 
GO 
exec sp_dboption N'N25175_hj', N'read only', N'false' 
GO 
exec sp_dboption N'N25175_hj', N'dbo use', N'false' 
GO 
exec sp_dboption N'N25175_hj', N'single', N'false' 
GO 
exec sp_dboption N'N25175_hj', N'autoshrink', N'true' 
GO 
exec sp_dboption N'N25175_hj', N'ANSI null default', N'false' 
GO 
exec sp_dboption N'N25175_hj', N'recursive triggers', N'false' 
GO 
exec sp_dboption N'N25175_hj', N'ANSI nulls', N'false' 
GO 
exec sp_dboption N'N25175_hj', N'concat null yields null', N'false' 
GO 
exec sp_dboption N'N25175_hj', N'cursor close on commit', N'false' 
GO 
exec sp_dboption N'N25175_hj', N'default to local cursor', N'false' 
GO 
exec sp_dboption N'N25175_hj', N'quoted identifier', N'false' 
GO 
exec sp_dboption N'N25175_hj', N'ANSI warnings', N'false' 
GO 
exec sp_dboption N'N25175_hj', N'auto create statistics', N'true' 
GO 
exec sp_dboption N'N25175_hj', N'auto update statistics', N'true' 
GO 
if( (@@microsoftversion / power(2, 24) = 8) and (@@microsoftversion & 0xffff >= 724) ) exec sp_dboption N'N25175_hj', N'db chaining', N'false' 
 GO 
use [N25175_hj] 
GO 
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[N25_Teachar_Basic]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) 
drop table [dbo].[N25_Teachar_Basic] 
GO 
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[N25_User_Manage]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) 
drop table [dbo].[N25_User_Manage] 
GO 
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[quanxian]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) 
drop table [dbo].[quanxian] 
GO 
CREATE TABLE [dbo].[N25_Teachar_Basic] ( 
[TeaId] [int] IDENTITY (1, 1) NOT NULL , 
[TeaName] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL , 
[Teapwd] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL , 
[TeaItemNO] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL , 
[TeaEmail] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL , 
[Tea_type] [int] NULL , 
[Tea_Dep] [int] NULL  
) ON [PRIMARY] 
GO 
CREATE TABLE [dbo].[N25_User_Manage] ( 
[UserId] [int] IDENTITY (1, 1) NOT NULL , 
[user_mainid] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL , 
[user_partid] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL , 
[user_page] [nvarchar] (1000) COLLATE Chinese_PRC_CI_AS NULL , 
[user_action] [nvarchar] (1000) COLLATE Chinese_PRC_CI_AS NULL , 
[user_zuid] [int] NULL , 
[user_teaid] [int] NULL  
) ON [PRIMARY] 
GO 
CREATE TABLE [dbo].[quanxian] ( 
[menuID] [int] IDENTITY (1, 1) NOT NULL , 
[menuParentID] [int] NOT NULL , 
[menuName] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL , 
[menuUrl] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL , 
[menubutton] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL , 
[men_title] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL , 
[page] [nvarchar] (500) COLLATE Chinese_PRC_CI_AS NULL , 
[Sub_ctrl] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL  
) ON [PRIMARY] 
GO 
ALTER TABLE [dbo].[N25_Teachar_Basic] WITH NOCHECK ADD  
CONSTRAINT [PK_N25_Basic_Teacher] PRIMARY KEY  CLUSTERED 
( 
[TeaId] )  ON [PRIMARY]  
GO 
ALTER TABLE [dbo].[N25_User_Manage] WITH NOCHECK ADD  
CONSTRAINT [PK_TABLE1_1] PRIMARY KEY  CLUSTERED 
(
[UserId] 
)  ON [PRIMARY]  
GO 
ALTER TABLE [dbo].[quanxian] WITH NOCHECK ADD  
CONSTRAINT [PK_TABLE1] PRIMARY KEY  CLUSTERED  
( 
[menuID] 
)  ON [PRIMARY]  
GO 
insert into [N25_Teachar_Basic] (TeaName,Teapwd,TeaItemNO,TeaEmail,Tea_type,Tea_Dep)values('admin','admin','admin','',1,'')
insert into [quanxian](menuParentID,menuName,menuUrl,menubutton,men_title,page,Sub_ctrl)values(0,'基础管理','','','','','')
