<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>安装矮个芝麻个人博客系统</title>
</head>

<body>
<!--#include file="inc/conn.asp"-->
<%
	sql = "
	IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'ai_blog')
	DROP DATABASE [ai_blog]
GO

exec sp_dboption N'ai_blog', N'autoclose', N'false'
GO

exec sp_dboption N'ai_blog', N'bulkcopy', N'false'
GO

exec sp_dboption N'ai_blog', N'trunc. log', N'true'
GO

exec sp_dboption N'ai_blog', N'torn page detection', N'false'
GO

exec sp_dboption N'ai_blog', N'read only', N'false'
GO

exec sp_dboption N'ai_blog', N'dbo use', N'false'
GO

exec sp_dboption N'ai_blog', N'single', N'false'
GO

exec sp_dboption N'ai_blog', N'autoshrink', N'true'
GO

exec sp_dboption N'ai_blog', N'ANSI null default', N'false'
GO

exec sp_dboption N'ai_blog', N'recursive triggers', N'false'
GO

exec sp_dboption N'ai_blog', N'ANSI nulls', N'false'
GO

exec sp_dboption N'ai_blog', N'concat null yields null', N'false'
GO

exec sp_dboption N'ai_blog', N'cursor close on commit', N'false'
GO

exec sp_dboption N'ai_blog', N'default to local cursor', N'false'
GO

exec sp_dboption N'ai_blog', N'quoted identifier', N'false'
GO

exec sp_dboption N'ai_blog', N'ANSI warnings', N'false'
GO

exec sp_dboption N'ai_blog', N'auto create statistics', N'true'
GO

exec sp_dboption N'ai_blog', N'auto update statistics', N'true'
GO

if( (@@microsoftversion / power(2, 24) = 8) and (@@microsoftversion & 0xffff >= 724) )
	exec sp_dboption N'ai_blog', N'db chaining', N'false'
GO

use [ai_blog]
GO

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

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

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

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

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

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

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

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

CREATE TABLE [dbo].[ai_Message] (
	[Message_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Article_id] [int] NULL ,
	[Message_user] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Message_text] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[Message_lianxi] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Message_date] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ai_article] (
	[Article_id] [int] IDENTITY (1, 1) NOT NULL ,
	[menu_Id] [int] NULL ,
	[Article_title] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Article_text] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[Article_zhaiyao] [varchar] (400) COLLATE Chinese_PRC_CI_AS NULL ,
	[Article_biaoqian] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Article_ding] [int] NULL ,
	[Article_cai] [int] NULL ,
	[Article_tongji] [int] NULL ,
	[Article_date] [datetime] NULL ,
	[Article_pinglunshu] [int] NULL ,
	[Article_tuijian] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[ai_menu] (
	[menu_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[menu_Text] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ai_system] (
	[system_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[system_password] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[system_passok] [int] NULL ,
	[system_Messageok] [int] NULL ,
	[system_title] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ai_users] (
	[Users_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[User_Usertext] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[User_Nickname] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[User_Password] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[User_Level] [int] NULL ,
	[User_bdel] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ai_xiangce] (
	[xiangce_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Xiangce_title] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Xiangce_text] [varchar] (300) COLLATE Chinese_PRC_CI_AS NULL ,
	[Xiangce_date] [datetime] NULL ,
	[Xiangce_fenlei] [int] NULL ,
	[Xiangce_name] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Xiangce_tuijian] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ai_xiangfen] (
	[menu_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[menu_Text] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ai_xiaxi] (
	[Xiaoxi_id] [int] IDENTITY (1, 1) NOT NULL ,
	[Xiaoxi_date] [datetime] NULL ,
	[Xiaoxi_text] [varchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[Xiaoxi_Ok] [int] NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[ai_Message] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[Message_Id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[ai_article] WITH NOCHECK ADD 
	CONSTRAINT [PK__ai_article__3D5E1FD2] PRIMARY KEY  CLUSTERED 
	(
		[Article_id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[ai_menu] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[menu_Id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[ai_system] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[system_Id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[ai_users] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[Users_Id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[ai_xiangce] WITH NOCHECK ADD 
	CONSTRAINT [PK_ai_xiangce] PRIMARY KEY  CLUSTERED 
	(
		[xiangce_Id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[ai_xiangfen] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[menu_Id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[ai_xiaxi] WITH NOCHECK ADD 
	CONSTRAINT [PK_ai_xiaxi] PRIMARY KEY  CLUSTERED 
	(
		[Xiaoxi_id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[ai_Message] ADD 
	CONSTRAINT [DF__ai_Messag__Messa__4316F928] DEFAULT (getdate()) FOR [Message_date]
GO

ALTER TABLE [dbo].[ai_article] ADD 
	CONSTRAINT [DF_ai_article_Article_zhaiyao] DEFAULT ('暂无摘要') FOR [Article_zhaiyao],
	CONSTRAINT [DF__ai_articl__Artic__3E52440B] DEFAULT (0) FOR [Article_ding],
	CONSTRAINT [DF__ai_articl__Artic__3F466844] DEFAULT (0) FOR [Article_cai],
	CONSTRAINT [DF__ai_articl__Artic__403A8C7D] DEFAULT (getdate()) FOR [Article_date],
	CONSTRAINT [DF_ai_article_Article_pinglunshu] DEFAULT (0) FOR [Article_pinglunshu],
	CONSTRAINT [DF_ai_article_Article_tuijian] DEFAULT (1) FOR [Article_tuijian]
GO

ALTER TABLE [dbo].[ai_system] ADD 
	CONSTRAINT [DF__ai_system__syste__35BCFE0A] DEFAULT (0) FOR [system_Messageok],
	CONSTRAINT [DF_ai_system_system_title] DEFAULT ('矮个芝麻-个人博客系统') FOR [system_title]
GO

ALTER TABLE [dbo].[ai_users] ADD 
	CONSTRAINT [DF__ai_users__User_L__38996AB5] DEFAULT (1) FOR [User_Level],
	CONSTRAINT [DF__ai_users__User_b__398D8EEE] DEFAULT (0) FOR [User_bdel]
GO

ALTER TABLE [dbo].[ai_xiangce] ADD 
	CONSTRAINT [DF_ai_xiangce_Xiangce_date] DEFAULT (getdate()) FOR [Xiangce_date]
GO

ALTER TABLE [dbo].[ai_xiaxi] ADD 
	CONSTRAINT [DF_ai_xiaxi_Xiaoxi_date] DEFAULT (getdate()) FOR [Xiaoxi_date],
	CONSTRAINT [DF_ai_xiaxi_Xiaoxi_Ok] DEFAULT (1) FOR [Xiaoxi_Ok]
GO
"
%>
</body>
</html>
