?? setup.txt
字號:
?SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
if exists (select * from sysobjects where id = object_id(N'[student]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [student]
;
CREATE TABLE [dbo].[student](
[id] [int] IDENTITY(1,1) NOT NULL,
[student_id] [nvarchar](50) NULL,
[name] [nvarchar](16) NULL,
[psw] [nvarchar](32) NULL CONSTRAINT [DF_student_psw] DEFAULT ('c4ca4238a0b923820dcc509a6f75849b'),
[sex] [bit] NULL CONSTRAINT [DF_student_sex] DEFAULT ('True'),
[classid] [int] NULL,
[zyname] [nvarchar](100) NULL,
CONSTRAINT [PK_student] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
if exists (select * from sysobjects where id = object_id(N'[records]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [records]
;
CREATE TABLE [dbo].[records](
[id] [int] IDENTITY(1,1) NOT NULL,
[year] [nvarchar](20) NULL,
[student] [int] NULL,
[scoretype] [int] NULL,
[recorder] [nvarchar](30) NULL,
[addtime] [datetime] NULL,
[showtext] [ntext] NULL,
[show] [bit] NULL,
[deltime] [datetime] NULL,
CONSTRAINT [PK_records] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
if exists (select * from sysobjects where id = object_id(N'[bigclass]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [bigclass]
;
CREATE TABLE [dbo].[bigclass](
[id] [int] IDENTITY(1,1) NOT NULL,
[classname] [nvarchar](100) NULL,
[show] [bit] NOT NULL CONSTRAINT [DF_bigclass_show] DEFAULT ('true'),
CONSTRAINT [PK_bigclass] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
if exists (select * from sysobjects where id = object_id(N'[secclass]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [secclass]
;
CREATE TABLE [dbo].[secclass](
[id] [int] IDENTITY(1,1) NOT NULL,
[classname] [nvarchar](100) NULL,
[show] [bit] NOT NULL CONSTRAINT [DF_secclass_show] DEFAULT ('true'),
CONSTRAINT [PK_secclass] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
if exists (select * from sysobjects where id = object_id(N'[setting]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [setting]
;
CREATE TABLE [dbo].[setting](
[id] [int] IDENTITY(1,1) NOT NULL,
[systemname] [nvarchar](50) NOT NULL CONSTRAINT [DF_setting_systemname] DEFAULT (''),
[copyright] [nvarchar](100) NOT NULL CONSTRAINT [DF_setting_copyright] DEFAULT (''),
[sn] [nvarchar](100) NOT NULL CONSTRAINT [DF_setting_sn] DEFAULT (''),
[radio] [ntext] NULL CONSTRAINT [DF_setting_radio] DEFAULT ('歡迎使用本系統!'),
[yearlist] [int] NULL CONSTRAINT [DF_setting_yearlist] DEFAULT ((10)),
[date] [datetime] NULL,
[template] [ntext] NULL,
[pxcs] [float] NULL CONSTRAINT [DF_setting_pxcs] DEFAULT ((70)),
[pxbl] [float] NULL CONSTRAINT [DF_setting_pxbl] DEFAULT ((40)),
[cjbl] [float] NULL CONSTRAINT [DF_setting_cjbl] DEFAULT ((60)),
CONSTRAINT [PK_setting] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
if exists (select * from sysobjects where id = object_id(N'[recordstemp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [recordstemp]
;
CREATE TABLE [dbo].[recordstemp](
[id] [int] IDENTITY(1,1) NOT NULL,
[year] [nvarchar](20) NULL,
[recid] [int] NULL,
[scoretype] [int] NULL,
[student] [int] NULL,
[recorder] [nvarchar](30) NULL,
[addtime] [datetime] NULL,
[showtext] [ntext] NULL,
[comtype] [int] NULL,
CONSTRAINT [PK_backto] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
if exists (select * from sysobjects where id = object_id(N'[events]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [events]
;
CREATE TABLE [dbo].[events](
[id] [int] IDENTITY(1,1) NOT NULL,
[info] [ntext] NULL,
[recorder] [nvarchar](30) NULL,
[eventtime] [datetime] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
if exists (select * from sysobjects where id = object_id(N'[scores]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [scores]
;
CREATE TABLE [dbo].[scores](
[id] [int] IDENTITY(1,1) NOT NULL,
[class] [int] NULL,
[prize] [nvarchar](255) NULL,
[prizetype] [nvarchar](255) NULL,
[scores] [float] NULL,
[showinfo] [ntext] NULL,
[show] [bit] NOT NULL CONSTRAINT [DF_scores_show] DEFAULT ('true'),
CONSTRAINT [PK_scores] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
if exists (select * from sysobjects where id = object_id(N'[result]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [result]
;
CREATE TABLE [dbo].[result](
[id] [int] IDENTITY(1,1) NOT NULL,
[mark] [float] NOT NULL,
[student_id] [int] NOT NULL,
[year] [nvarchar](20) NULL,
[cjfz] [float] NULL CONSTRAINT [DF_result_cjfz] DEFAULT ((0)),
[final] [float] NULL CONSTRAINT [DF_result_final] DEFAULT ((0)),
CONSTRAINT [PK_result] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
if exists (select * from sysobjects where id = object_id(N'[backup]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [backup]
;
CREATE TABLE [dbo].[backup](
[id] [int] IDENTITY(1,1) NOT NULL,
[date] [datetime] NOT NULL CONSTRAINT [DF_backup_date] DEFAULT (getdate()),
[sm] [nvarchar](200) NULL,
[size] [nvarchar](50) NULL,
[filename] [nvarchar](50) NULL,
CONSTRAINT [PK_backup] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
if exists (select * from sysobjects where id = object_id(N'[user]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [user]
;
CREATE TABLE [dbo].[user](
[id] [int] IDENTITY(1,1) NOT NULL,
[username] [nvarchar](24) NULL,
[password] [nvarchar](32) NULL,
[sname] [nvarchar](30) NULL,
[rank] [ntext] NULL,
[lower] [bit] NULL CONSTRAINT [DF_user_lower] DEFAULT ('False'),
[cookies] [nvarchar](32) NULL,
[temp] [nvarchar](100) NULL CONSTRAINT [DF_user_temp] DEFAULT (''),
CONSTRAINT [PK_user] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
if exists (select * from sysobjects where id = object_id(N'[yx]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [yx]
;
CREATE TABLE [dbo].[yx](
[id] [int] IDENTITY(1,1) NOT NULL,
[yxname] [nvarchar](30) NULL,
CONSTRAINT [PK_yx] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
if exists (select * from sysobjects where id = object_id(N'[class]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [class]
;
CREATE TABLE [dbo].[class](
[id] [int] IDENTITY(1,1) NOT NULL,
[class] [nvarchar](50) NULL,
[yxid] [int] NULL,
[classyear] [int] NULL,
CONSTRAINT [PK_class] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -