if exists (select * from sysobjects where id = OBJECT_ID('[Admin]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [Admin]

CREATE TABLE [Admin] (
[id] [int]  IDENTITY (1, 1)  NOT NULL,
[adminname] [nvarchar]  (50) NULL,
[adminpass] [nvarchar]  (50) NULL,
[flag] [text]  NULL,
[isadmin] [varchar]  (1) NULL,
[allowip] [text]  NULL,
[iswg] [varchar]  (1) NULL,
[company] [text]  NULL,
[dept] [text]  NULL,
[workgroup] [text]  NULL,
[isagent] [varchar]  (1) NULL,
[starttime] [datetime]  NULL,
[endtime] [datetime]  NULL,
[zg] [varchar]  (50) NULL,
[limit1] [varchar]  (1) NULL,
[limit2] [varchar]  (1) NULL)

ALTER TABLE [Admin] WITH NOCHECK ADD  CONSTRAINT [PK_Admin] PRIMARY KEY  NONCLUSTERED ( [id] )
SET IDENTITY_INSERT [Admin] ON

INSERT [Admin] ([id],[adminname],[adminpass],[flag],[isadmin]) VALUES ( 1,N'admin',N'21232f297a57a5a743894ae4a801fc3',N',',N'1')

SET IDENTITY_INSERT [Admin] OFF
if exists (select * from sysobjects where id = OBJECT_ID('[Admin_Log]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [Admin_Log]

CREATE TABLE [Admin_Log] (
[ID] [int]  IDENTITY (1, 1)  NOT NULL,
[ActionPostion] [varchar]  (50) NULL,
[Action] [text]  NULL,
[ActionTime] [datetime]  NULL,
[IP] [varchar]  (50) NULL,
[ActionUser] [varchar]  (50) NULL,
[type] [varchar]  (1) NULL,
[ToUser] [varchar]  (50) NULL)

ALTER TABLE [Admin_Log] WITH NOCHECK ADD  CONSTRAINT [PK_Admin_Log] PRIMARY KEY  NONCLUSTERED ( [ID] )

SET IDENTITY_INSERT [Admin_Log] OFF
if exists (select * from sysobjects where id = OBJECT_ID('[AllPath]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [AllPath]

CREATE TABLE [AllPath] (
[id] [int]  IDENTITY (1, 1)  NOT NULL,
[UserName] [varchar]  (50) NULL,
[Postion] [varchar]  (255) NULL,
[DirName] [varchar]  (100) NULL,
[FileName] [varchar]  (100) NULL,
[FileSize] [int]  NULL,
[FileExt] [varchar]  (10) NULL,
[LastTime] [datetime]  NULL,
[Note] [varchar]  (255) NULL,
[Share] [varchar]  (1) NULL,
[uploadperson] [varchar]  (20) NULL,
[MailCode] [varchar]  (20) NULL,
[Root] [varchar]  (1) NULL,
[MailCodecount] [int]  NULL,
[IsDel] [varchar]  (1) NULL,
[share1company] [varchar]  (255) NULL,
[share1dept] [varchar]  (255) NULL,
[share1workgroup] [varchar]  (255) NULL,
[share1user] [text]  NULL,
[share2company] [varchar]  (255) NULL,
[share2dept] [varchar]  (255) NULL,
[share2workgroup] [varchar]  (255) NULL,
[share2user] [text]  NULL,
[share3company] [varchar]  (255) NULL,
[share3dept] [varchar]  (255) NULL,
[share3workgroup] [varchar]  (255) NULL,
[share3user] [text]  NULL,
[maildowntime] [int]  NULL,
[maildowncount] [int]  NULL,
[editperson] [varchar]  (20) NULL,
[mark] [varchar]  (1) NULL,
[PickTime] [datetime]  NULL,
[PickCode] [varchar]  (50) NULL,
[UploadCode] [varchar]  (50) NULL,
[UploadCodeTime] [datetime]  NULL,
[share4company] [varchar]  (255) NULL,
[share4dept] [varchar]  (255) NULL,
[share4workgroup] [varchar]  (255) NULL,
[share4user] [text]  NULL,
[note1] [varchar]  (255) NULL,
[note2] [varchar]  (255) NULL,
[note3] [varchar]  (255) NULL,
[qs] [varchar]  (1) NULL,
[lockname] [varchar]  (50) NULL,
[locktime] [varchar]  (50) NULL,
[marktime] [datetime]  NULL,
[kind] [int]  NULL,
[shareall] [varchar]  (1) NULL,
[downcount] [int]  NULL DEFAULT (0),
[userrole] [varchar]  (1) NULL,
[iszy] [varchar]  (1) NULL,
[jcvar] [int]  NULL,
[nj] [int]  NULL,
[zytype] [int]  NULL,
[km] [int]  NULL,
[markzy] [varchar]  (1) NULL,
[zykind] [int]  NULL,
[safe] [int]  NULL,
[IsRecommendZY] [char]  (1) NULL DEFAULT ('0'))

ALTER TABLE [AllPath] WITH NOCHECK ADD  CONSTRAINT [PK_AllPath] PRIMARY KEY  NONCLUSTERED ( [id] )
SET IDENTITY_INSERT [AllPath] ON

SET IDENTITY_INSERT [AllPath] OFF
if exists (select * from sysobjects where id = OBJECT_ID('[allpathqs]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [allpathqs]

CREATE TABLE [allpathqs] (
[id] [int]  IDENTITY (1, 1)  NOT NULL,
[allpathid] [int]  NULL,
[username] [varchar]  (50) NULL,
[content] [text]  NULL,
[datetime] [datetime]  NULL)

ALTER TABLE [allpathqs] WITH NOCHECK ADD  CONSTRAINT [PK_allpathqs] PRIMARY KEY  NONCLUSTERED ( [id] )
SET IDENTITY_INSERT [allpathqs] ON


SET IDENTITY_INSERT [allpathqs] OFF
if exists (select * from sysobjects where id = OBJECT_ID('[Anser]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [Anser]

CREATE TABLE [Anser] (
[ID] [int]  IDENTITY (1, 1)  NOT NULL,
[QuestionID] [int]  NOT NULL,
[AnswerUser] [varchar]  (200) NOT NULL,
[AnswerDateTime] [datetime]  NULL DEFAULT (getdate()),
[Answer] [text]  NOT NULL,
[Remark] [varchar]  (800) NULL,
[IsAudit] [char]  (1) NULL DEFAULT ('0'))

ALTER TABLE [Anser] WITH NOCHECK ADD  CONSTRAINT [PK_Anser] PRIMARY KEY  NONCLUSTERED ( [ID] )
SET IDENTITY_INSERT [Anser] ON

SET IDENTITY_INSERT [Anser] OFF
if exists (select * from sysobjects where id = OBJECT_ID('[Company]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [Company]

CREATE TABLE [Company] (
[ID] [int]  IDENTITY (1, 1)  NOT NULL,
[company] [varchar]  (100) NOT NULL)

ALTER TABLE [Company] WITH NOCHECK ADD  CONSTRAINT [PK_Company] PRIMARY KEY  NONCLUSTERED ( [ID] )
SET IDENTITY_INSERT [Company] ON

INSERT [Company] ([ID],[company]) VALUES ( 1,N'XX学校')


SET IDENTITY_INSERT [Company] OFF
if exists (select * from sysobjects where id = OBJECT_ID('[Config]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [Config]

CREATE TABLE [Config] (
[id] [int]  IDENTITY (1, 1)  NOT NULL,
[userpath] [varchar]  (100) NULL,
[NoType] [text]  NULL,
[allowType] [text]  NULL,
[uploadmode] [varchar]  (1) NULL,
[downmode] [varchar]  (1) NULL,
[allowreg] [varchar]  (1) NULL,
[regSH] [varchar]  (1) NULL,
[filetype] [text]  NULL,
[editfiletype] [text]  NULL,
[picfiletype] [text]  NULL,
[playfiletype] [text]  NULL,
[title] [varchar]  (100) NULL,
[Mailip] [varchar]  (50) NULL,
[Mailname] [varchar]  (50) NULL,
[Downcount] [varchar]  (50) NULL,
[Mailusername] [varchar]  (50) NULL,
[Mailpassword] [varchar]  (50) NULL,
[bottom] [text]  NULL,
[userlist] [varchar]  (1) NULL,
[mailval] [varchar]  (1) NULL,
[dupip] [varchar]  (1) NULL,
[dupregtime] [int]  NULL,
[maildowntime] [int]  NULL,
[mailcontent] [text]  NULL,
[linecount] [int]  NULL,
[len1] [int]  NULL,
[len2] [int]  NULL,
[len3] [int]  NULL,
[len4] [int]  NULL,
[maildowncount] [int]  NULL,
[editpictype] [text]  NULL,
[logo] [varchar]  (200) NULL,
[temppath] [varchar]  (255) NULL,
[allowip] [text]  NULL,
[passtype] [varchar]  (1) NULL,
[passmailt] [varchar]  (100) NULL,
[passmail] [text]  NULL,
[expirymailt] [varchar]  (100) NULL,
[expirymail] [text]  NULL,
[markmailt] [varchar]  (100) NULL,
[markmail] [text]  NULL,
[regsuccmailt] [varchar]  (100) NULL,
[regsuccmail] [text]  NULL,
[sendregsucc] [varchar]  (1) NULL,
[allowregip] [text]  NULL,
[url] [varchar]  (50) NULL,
[syskey] [varchar]  (20) NULL,
[regday] [int]  NULL,
[regsize] [int]  NULL,
[markshare] [varchar]  (1) NULL,
[trashday] [varchar]  (50) NULL,
[useropr] [varchar]  (1) NULL,
[mrrole] [varchar]  (1) NULL,
[mruploadmode] [varchar]  (1) NULL,
[mrintopostion] [varchar]  (1) NULL,
[team] [varchar]  (50) NULL,
[single] [varchar]  (1) NULL,
[mrorder] [varchar]  (50) NULL,
[newdir] [varchar]  (1) NULL,
[banner] [text]  NULL,
[banner1] [text]  NULL,
[login] [varchar]  (1) NULL,
[weburl] [varchar]  (255) NULL,
[schoolname] [varchar]  (255) NULL,
[textsearch] [varchar]  (1) NULL,
[issharesh1] [varchar]  (1) NULL,
[iszysh1] [varchar]  (1) NULL,
[issharesh2] [varchar]  (1) NULL,
[iszysh2] [varchar]  (1) NULL,
[issharesh3] [varchar]  (1) NULL,
[iszysh3] [varchar]  (1) NULL,
[AdvertiseLogo] [varchar]  (255) NULL,
[QuestionNeedToAudit] [char]  (1) NULL,
[AllowGG1] [char]  (1) NULL DEFAULT ('0'),
[AllowGG2] [char]  (1) NULL DEFAULT ('0'),
[AllowGG3] [char]  (1) NULL DEFAULT ('0'),
[editsoft] [char]  (1) NULL DEFAULT ('0'))

ALTER TABLE [Config] WITH NOCHECK ADD  CONSTRAINT [PK_Config] PRIMARY KEY  NONCLUSTERED ( [id] )
SET IDENTITY_INSERT [Config] ON

INSERT [Config] ([id],[userpath],[NoType],[allowType],[uploadmode],[downmode],[allowreg],[regSH],[filetype],[editfiletype],[picfiletype],[playfiletype],[title],[Mailip],[Mailname],[Downcount],[Mailusername],[Mailpassword],[bottom],[mailval],[dupip],[dupregtime],[maildowntime],[mailcontent],[linecount],[len1],[len2],[len3],[len4],[maildowncount],[editpictype],[logo],[temppath],[passtype],[passmailt],[passmail],[markmailt],[markmail],[regsuccmailt],[regsuccmail],[sendregsucc],[regday],[regsize],[markshare],[trashday],[useropr],[mrrole],[mruploadmode],[mrintopostion],[single],[mrorder],[newdir],[banner],[login],[weburl],[schoolname],[textsearch],[iszysh1],[issharesh2],[iszysh2],[QuestionNeedToAudit],[AllowGG1],[AllowGG2],[AllowGG3],[editsoft]) VALUES ( 1,N'myfile/',N'asp,aspx,php,jsp,cgi,asa,cer,cdx,hta',N'exe,zip,rar,mid,gif,htm,html,jpeg,jpg,bmp,avi,mp3,txt,swf,rm',N'1',N'1',N'1',N'0',N'ace,app,arj,asp,av,avi,bmp,cab,cad,chm,com,dll,doc,docx,exe,ftp,gif,htm,html,jpeg,jpg,m3u,mdb,mid,mov,mp3,mpeg,mpg,pdf,png,ppt,pptx,rar,rm,swf,txt,vsd,wav,wma,wmv,xls,xlsx,zip,url',N'txt,aspx,ascx,asax,cs,vb,js,config,asa,asp,htm,html,cfm,css,inc,ini,doc,xls,docx,xlsx',N'jpg,jpeg,gif,bmp,png',N'mid,rm,rmvb,mov,mpeg,mpg,avi,mp3,wma,swf,wmv',N'校园网络硬盘管理系统',N'smtp.163.com',N'mytaoyuan.com@163.com',N'3',N'mytaoyuan.com',N'123456',N'<div>
            <span><a href="http://www.mytaoyuan.com/company/">关于桃源</a> | <a href="http://www.mytaoyuan.com/company/contact.asp">联系我们</a> | <a href="http://www.mytaoyuan.com/company/pay.asp">付款方式 </a> | <a href="http://www.mytaoyuan.com/company/job.asp">招贤纳士 </a> | <a href="http://www.mytaoyuan.com/company/copyright.asp">法律声明 </a> | <a href="http://www.mytaoyuan.com/company/zs.asp">相关证书 </a></span>
            <p>Copyright &copy; 2004-2013  <a href="http://www.mytaoyuan.com/">www.MyTaoYuan.com</a>  All Rights Reserved</p>
            <p><a href="http://www.mytaoyuan.com/">深圳市盛世桃源网络科技有限公司</a> 版权所有 <a href="http://www.miibeian.gov.cn/state/outPortal/loginPortal.action;jsessionid=clFST5wMXJkJZR1GJjWVC1gJQkqCvxJTHrtTLlfxRhmXyPsh7nQF!1658063959">粤ICP备10101762号</a></p>
        </div>',N'0',N'1',0,3,N'<p>文件请查收</p>
<p>&fromname 从桃源网络硬盘http://www.1disk.cn/处给您发送一份文件,请在规定时间内点击下载。</p>
<p>邮件内容：</p>
<p>&content</p>
<p>文件列表:(如果链接不能正常下载，请用HTML格式察看邮件)</p>
<p>&downurl</p>
<p>注意:文件链接的过期时间为&downtime</p>
<p>桃源网络硬盘提供方便快捷的网络存储服务，支持文件各种权限共享、提取文件、文件转发、二级域名访问、我的好友、公共目录及文件共享、访客下载、压缩解压、短信、留言等各种功能。</p>
<p>发送人邮箱地址：</p>
<p>&frommail</p>',20,1,10,1,10,1,N'jpg,gif,png,bmp',N'images/logo_top.png',N'temp',N'0',N'您校园网络硬盘管理里系统中找回账号密码邮件',N'请点击以下链接以便重新设置您的密码：<br>&url',N'您校园网络硬盘管理系统中激活密码邮件',N'请点击以下链接激活您的网盘密码：<br>&url',N'欢迎您注册盛世桃源校园网络硬盘管理系统',N'以下是您的注册信息<p>&userinfo',N'0',-1,-1,N'0',N'3',N'1',N'1',N'0',N'0',N'1',N'update desc',N'1',N'<img class="AD" id="imgAD" src="images/banner_01.png" />',N'1',N'http://www.mytaoyuan.com',N'XX学院',N'0',N'1',N'1',N'1',N'0',N'1',N'1',N'0',N'0')

SET IDENTITY_INSERT [Config] OFF
if exists (select * from sysobjects where id = OBJECT_ID('[Dept]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [Dept]

CREATE TABLE [Dept] (
[ID] [int]  IDENTITY (1, 1)  NOT NULL,
[company] [int]  NULL,
[root] [int]  NULL,
[Kname] [varchar]  (255) NULL,
[Korder] [int]  NULL,
[Depth] [int]  NULL)

ALTER TABLE [Dept] WITH NOCHECK ADD  CONSTRAINT [PK_Dept] PRIMARY KEY  NONCLUSTERED ( [ID] )
SET IDENTITY_INSERT [Dept] ON

INSERT [Dept] ([ID],[company],[root],[Kname],[Depth]) VALUES ( 3,1,0,N'初一',0)
INSERT [Dept] ([ID],[company],[root],[Kname],[Depth]) VALUES ( 4,1,0,N'初二',0)
INSERT [Dept] ([ID],[company],[root],[Kname],[Depth]) VALUES ( 5,1,3,N'初一（1）班',1)
INSERT [Dept] ([ID],[company],[root],[Kname],[Depth]) VALUES ( 6,1,3,N'初一（2）班',1)
INSERT [Dept] ([ID],[company],[root],[Kname],[Depth]) VALUES ( 7,1,3,N'初一（3）班',1)
INSERT [Dept] ([ID],[company],[root],[Kname],[Depth]) VALUES ( 8,1,4,N'初二（1）班',1)
INSERT [Dept] ([ID],[company],[root],[Kname],[Depth]) VALUES ( 9,1,4,N'初二（2）班',1)
INSERT [Dept] ([ID],[company],[root],[Kname],[Depth]) VALUES ( 10,1,4,N'初二（3）班',1)
INSERT [Dept] ([ID],[company],[root],[Kname],[Depth]) VALUES ( 11,2,0,N'中学部',0)
INSERT [Dept] ([ID],[company],[root],[Kname],[Depth]) VALUES ( 12,2,0,N'高中部',0)
INSERT [Dept] ([ID],[company],[root],[Kname],[Depth]) VALUES ( 13,2,12,N'高一（1）班',1)
INSERT [Dept] ([ID],[company],[root],[Kname],[Depth]) VALUES ( 14,2,12,N'高一（2）班',1)
INSERT [Dept] ([ID],[company],[root],[Kname],[Depth]) VALUES ( 15,2,12,N'高二（1）班',1)
INSERT [Dept] ([ID],[company],[root],[Kname],[Depth]) VALUES ( 16,2,11,N'初一',1)
INSERT [Dept] ([ID],[company],[root],[Kname],[Depth]) VALUES ( 17,2,16,N'初一(1)班',2)
INSERT [Dept] ([ID],[company],[root],[Kname],[Depth]) VALUES ( 18,2,16,N'初一(2)班',2)

SET IDENTITY_INSERT [Dept] OFF
if exists (select * from sysobjects where id = OBJECT_ID('[FileComments]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [FileComments]

CREATE TABLE [FileComments] (
[ID] [int]  IDENTITY (1, 1)  NOT NULL,
[FileID] [int]  NOT NULL,
[Comment] [varchar]  (2) NOT NULL,
[CommentUser] [varchar]  (20) NOT NULL,
[CommentDate] [datetime]  NOT NULL,
[Remark] [varchar]  (200) NULL)

ALTER TABLE [FileComments] WITH NOCHECK ADD  CONSTRAINT [PK_FileComments] PRIMARY KEY  NONCLUSTERED ( [ID] )


if exists (select * from sysobjects where id = OBJECT_ID('[FileOperation]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [FileOperation]

CREATE TABLE [FileOperation] (
[ID] [int]  IDENTITY (1, 1)  NOT NULL,
[AllPathID] [int]  NOT NULL,
[ViewedTime] [datetime]  NULL,
[ViewedUser] [varchar]  (50) NULL,
[DownLoadTime] [datetime]  NULL,
[DownLoadUser] [varchar]  (50) NULL,
[ShareTime] [datetime]  NULL,
[ShaerUser] [varchar]  (50) NULL,
[ForwardTime] [datetime]  NULL,
[ForwardUser] [varchar]  (50) NULL,
[Remark] [varchar]  (200) NULL)

ALTER TABLE [FileOperation] WITH NOCHECK ADD  CONSTRAINT [PK_FileOperation] PRIMARY KEY  NONCLUSTERED ( [ID] )


if exists (select * from sysobjects where id = OBJECT_ID('[Friend]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [Friend]

CREATE TABLE [Friend] (
[id] [int]  IDENTITY (1, 1)  NOT NULL,
[UserName] [varchar]  (100) NULL,
[FriendName] [varchar]  (100) NULL,
[Team] [int]  NULL)

ALTER TABLE [Friend] WITH NOCHECK ADD  CONSTRAINT [PK_Friend] PRIMARY KEY  NONCLUSTERED ( [id] )


if exists (select * from sysobjects where id = OBJECT_ID('[FriendTeam]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [FriendTeam]

CREATE TABLE [FriendTeam] (
[id] [int]  IDENTITY (1, 1)  NOT NULL,
[username] [varchar]  (50) NULL,
[friendteam] [varchar]  (50) NULL)

ALTER TABLE [FriendTeam] WITH NOCHECK ADD  CONSTRAINT [PK_FriendTeam] PRIMARY KEY  NONCLUSTERED ( [id] )


if exists (select * from sysobjects where id = OBJECT_ID('[GG]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [GG]

CREATE TABLE [GG] (
[id] [int]  IDENTITY (1, 1)  NOT NULL,
[company] [text]  NULL,
[dept] [text]  NULL,
[workgroup] [text]  NULL,
[guest] [varchar]  (1) NULL,
[title] [varchar]  (255) NULL,
[content] [text]  NULL,
[datetime] [datetime]  NULL,
[adduser] [varchar]  (50) NULL,
[postion] [varchar]  (1) NULL,
[type] [varchar]  (50) NULL,
[role] [varchar]  (50) NULL)

ALTER TABLE [GG] WITH NOCHECK ADD  CONSTRAINT [PK_GG] PRIMARY KEY  NONCLUSTERED ( [id] )


if exists (select * from sysobjects where id = OBJECT_ID('[kind]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [kind]

CREATE TABLE [kind] (
[id] [int]  IDENTITY (1, 1)  NOT NULL,
[root] [int]  NULL,
[kind] [varchar]  (50) NULL,
[korder] [int]  NULL,
[role] [varchar]  (1) NULL)

ALTER TABLE [kind] WITH NOCHECK ADD  CONSTRAINT [PK_kind] PRIMARY KEY  NONCLUSTERED ( [id] )
SET IDENTITY_INSERT [kind] ON

INSERT [kind] ([id],[root],[kind],[korder],[role]) VALUES ( 1,0,N'JS',1,N'1')
INSERT [kind] ([id],[root],[kind],[korder],[role]) VALUES ( 2,0,N'LD',3,N'6')
INSERT [kind] ([id],[root],[kind],[korder],[role]) VALUES ( 3,0,N'JW',2,N'2')
INSERT [kind] ([id],[root],[kind],[korder],[role]) VALUES ( 4,0,N'XS',4,N'3')
INSERT [kind] ([id],[root],[kind],[korder],[role]) VALUES ( 5,0,N'ZY',5,N'4')
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 6,1,N'教学研究',1)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 7,1,N'教案交流',2)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 8,1,N'教学参考',3)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 9,1,N'课件交流',4)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 10,1,N'其它文件',5)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 11,3,N'政策文件',1)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 12,3,N'管理规定',2)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 13,3,N'通知公告',3)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 14,3,N'其它文件',4)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 15,2,N'教育管理',1)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 16,2,N'政策资料',2)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 17,2,N'学习参考',3)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 18,2,N'其它文件',4)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 19,4,N'学习参考',1)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 20,4,N'课外资料',2)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 21,4,N'同学交流',3)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 22,4,N'文件分享',4)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 23,4,N'其它文件',5)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 24,5,N'语文',1)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 25,5,N'数学',2)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 26,5,N'英语',3)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 27,5,N'地理',4)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 28,5,N'历史',5)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 29,5,N'物理',6)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 30,5,N'化学',7)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 31,5,N'其它',8)
INSERT [kind] ([id],[root],[kind],[korder]) VALUES ( 0,-1,N'默认类别',0)

SET IDENTITY_INSERT [kind] OFF
if exists (select * from sysobjects where id = OBJECT_ID('[Menu]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [Menu]

CREATE TABLE [Menu] (
[id] [int]  IDENTITY (1, 1)  NOT NULL,
[ParentNodeId] [int]  NULL,
[Text] [varchar]  (100) NULL,
[ImageUrl] [varchar]  (100) NULL,
[Url] [varchar]  (255) NULL,
[Target] [varchar]  (10) NULL,
[Show] [varchar]  (1) NULL,
[OrderID] [int]  NULL,
[Sys] [varchar]  (1) NULL,
[Depth] [int]  NULL,
[Expand] [varchar]  (1) NULL,
[m] [varchar]  (1) NULL)

ALTER TABLE [Menu] WITH NOCHECK ADD  CONSTRAINT [PK_Menu] PRIMARY KEY  NONCLUSTERED ( [id] )
SET IDENTITY_INSERT [Menu] ON

INSERT [Menu] ([id],[Text],[ImageUrl],[Url],[Target],[Show],[OrderID],[Sys],[Depth],[m]) VALUES ( 1,N'我的空间',N'pics/my_space_s.gif',N'ContentPane.aspx',N'wdcontent',N'1',2,N'0',0,N'1')
INSERT [Menu] ([id],[Text],[ImageUrl],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 2,N'我的共享',N'pics/folder_sharing_s.gif',N'wdcontent',N'1',3,N'0',0)
INSERT [Menu] ([id],[ParentNodeId],[Text],[ImageUrl],[Url],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 3,2,N'已共享目录',N'pics/folder_sharing_s.gif',N'sharesee.aspx?type=1',N'wdcontent',N'1',4,N'0',1)
INSERT [Menu] ([id],[ParentNodeId],[Text],[ImageUrl],[Url],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 4,2,N'已共享文件',N'pics/filesys.gif',N'sharesee.aspx?type=2',N'wdcontent',N'1',5,N'0',1)
INSERT [Menu] ([id],[Text],[ImageUrl],[Url],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 5,N'查找用户',N'pics/my-sharing.gif',N'search_user.aspx',N'wdcontent',N'1',16,N'0',0)
INSERT [Menu] ([id],[Text],[ImageUrl],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 7,N'短信管理',N'pics/inbox.gif',N'wdcontent',N'1',17,N'0',0)
INSERT [Menu] ([id],[ParentNodeId],[Text],[ImageUrl],[Url],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 8,7,N'收件箱',N'pics/mail_state_1.gif',N'user_sms.aspx?type=1',N'wdcontent',N'1',18,N'0',1)
INSERT [Menu] ([id],[ParentNodeId],[Text],[ImageUrl],[Url],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 9,7,N'发件箱',N'pics/mail_state_3.gif',N'user_sms.aspx?type=2',N'wdcontent',N'1',19,N'0',1)
INSERT [Menu] ([id],[ParentNodeId],[Text],[ImageUrl],[Url],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 10,7,N'已发送',N'pics/mail_state_4.gif',N'user_sms.aspx?type=3',N'wdcontent',N'1',20,N'0',1)
INSERT [Menu] ([id],[ParentNodeId],[Text],[ImageUrl],[Url],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 11,7,N'废件箱',N'pics/mail_state_2.gif',N'user_sms.aspx?type=4',N'wdcontent',N'1',21,N'0',1)
INSERT [Menu] ([id],[Text],[ImageUrl],[Url],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 12,N'个人信息',N'pics/contacts.gif',N'regedit.aspx',N'wdcontent',N'1',24,N'0',0)
INSERT [Menu] ([id],[Text],[ImageUrl],[Url],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 13,N'退出登录',N'pics/exits.gif',N'exit.aspx',N'_top',N'1',25,N'0',0)
INSERT [Menu] ([id],[Text],[ImageUrl],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 14,N'文件签收',N'pics/menu_file_cut.gif',N'wdcontent',N'1',7,N'0',0)
INSERT [Menu] ([id],[ParentNodeId],[Text],[ImageUrl],[Url],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 15,14,N'签收目录',N'pics/menu_file_cut.gif',N'allfolder.aspx',N'wdcontent',N'1',8,N'0',1)
INSERT [Menu] ([id],[ParentNodeId],[Text],[ImageUrl],[Url],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 16,14,N'签收文件',N'pics/menu_file_cut.gif',N'allshare.aspx',N'wdcontent',N'1',9,N'0',1)
INSERT [Menu] ([id],[Text],[ImageUrl],[Url],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 17,N'回 收 站',N'pics/trash_s.gif',N'trash.aspx',N'wdcontent',N'1',10,N'0',0)
INSERT [Menu] ([id],[Text],[ImageUrl],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 18,N'常用人员',N'pics/member.gif',N'wdcontent',N'1',13,N'0',0)
INSERT [Menu] ([id],[ParentNodeId],[Text],[ImageUrl],[Url],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 19,18,N'人员列表',N'pics/member.gif',N'myfriend.aspx',N'wdcontent',N'1',14,N'0',1)
INSERT [Menu] ([id],[ParentNodeId],[Text],[ImageUrl],[Url],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 20,18,N'人员分组',N'pics/member.gif',N'myfriendteam.aspx',N'wdcontent',N'1',15,N'0',1)
INSERT [Menu] ([id],[ParentNodeId],[Text],[ImageUrl],[Url],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 21,2,N'已转发文件',N'pics/zf.gif',N'mysend.aspx',N'wdcontent',N'1',6,N'0',1)
INSERT [Menu] ([id],[ParentNodeId],[Text],[ImageUrl],[Url],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 22,2,N'已设提取码',N'pics/distill.gif',N'codelist.aspx',N'wdcontent',N'1',6,N'0',1)
INSERT [Menu] ([id],[ParentNodeId],[Text],[ImageUrl],[Url],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 23,2,N'已设上传码',N'pics/distill.gif',N'uploadcodelist.aspx',N'wdcontent',N'1',6,N'0',1)
INSERT [Menu] ([id],[Text],[ImageUrl],[Url],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 24,N'操作记录',N'pics/drafts.gif',N'record.aspx',N'wdcontent',N'1',11,N'0',0)
INSERT [Menu] ([id],[Text],[ImageUrl],[Url],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 25,N'空间信息',N'pics/space.gif',N'spaceinfo.aspx',N'wdcontent',N'1',24,N'0',0)
INSERT [Menu] ([id],[Text],[ImageUrl],[Url],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 26,N'个性设置',N'pics/syssetup.gif',N'mysetup.aspx',N'wdcontent',N'1',23,N'0',0)
INSERT [Menu] ([id],[Text],[ImageUrl],[Url],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 27,N'全文检索',N'pics/my_space_s.gif',N'search.aspx',N'wdcontent',N'0',3,N'0',0)
INSERT [Menu] ([id],[ParentNodeId],[Text],[ImageUrl],[Url],[Target],[Show],[OrderID],[Sys],[Depth]) VALUES ( 32,2,N'已发资源文件',N'pics/folder_sharing_s.gif',N'MyResourceMng.aspx',N'wdcontent',N'1',7,N'0',1)

SET IDENTITY_INSERT [Menu] OFF
if exists (select * from sysobjects where id = OBJECT_ID('[Message]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [Message]

CREATE TABLE [Message] (
[id] [int]  IDENTITY (1, 1)  NOT NULL,
[From_User] [varchar]  (50) NULL,
[To_User] [varchar]  (50) NULL,
[Title] [varchar]  (255) NULL,
[Content] [text]  NULL,
[SendTime] [datetime]  NULL,
[InceptTime] [datetime]  NULL,
[Type] [varchar]  (1) NULL,
[friend] [varchar]  (50) NULL)

ALTER TABLE [Message] WITH NOCHECK ADD  CONSTRAINT [PK_Message] PRIMARY KEY  NONCLUSTERED ( [id] )

if exists (select * from sysobjects where id = OBJECT_ID('[Question]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [Question]

CREATE TABLE [Question] (
[ID] [int]  IDENTITY (1, 1)  NOT NULL,
[QuestionType] [char]  (2) NULL,
[QuestionUser] [varchar]  (50) NOT NULL,
[Question] [varchar]  (800) NOT NULL,
[QuestionDateTime] [datetime]  NULL,
[AnswerCount] [int]  NULL,
[IsAudit] [char]  (1) NULL DEFAULT ('0'),
[Remark] [varchar]  (200) NULL)

ALTER TABLE [Question] WITH NOCHECK ADD  CONSTRAINT [PK_Question] PRIMARY KEY  NONCLUSTERED ( [ID] )

if exists (select * from sysobjects where id = OBJECT_ID('[Reg]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [Reg]

CREATE TABLE [Reg] (
[id] [int]  IDENTITY (1, 1)  NOT NULL,
[uusername] [varchar]  (50) NULL,
[upassword] [varchar]  (50) NULL,
[uemail] [varchar]  (50) NULL,
[ulock] [varchar]  (50) NULL,
[umark] [varchar]  (50) NULL,
[sex] [varchar]  (2) NULL,
[url] [varchar]  (255) NULL,
[qq] [varchar]  (10) NULL,
[msn] [varchar]  (50) NULL,
[realname] [varchar]  (50) NULL,
[phone] [varchar]  (20) NULL,
[address] [varchar]  (255) NULL,
[company] [int]  NULL,
[dept] [int]  NULL,
[workgroup] [int]  NULL,
[spacesize] [int]  NULL,
[spacetotal] [int]  NULL,
[enddate] [datetime]  NULL,
[regdate] [datetime]  NULL,
[uplogin] [datetime]  NULL,
[passcode] [varchar]  (100) NULL,
[mailmark] [varchar]  (50) NULL,
[ip] [varchar]  (20) NULL,
[style] [int]  NULL,
[logincount] [int]  NULL,
[dept2] [int]  NULL,
[dept3] [int]  NULL,
[dept4] [int]  NULL,
[dept5] [int]  NULL,
[mangeadd] [varchar]  (1) NULL,
[usetrash] [varchar]  (1) NULL,
[autorename] [varchar]  (1) NULL,
[allowip] [varchar]  (255) NULL,
[overshare] [varchar]  (1) NULL,
[role] [int]  NULL,
[uploadmode] [varchar]  (1) NULL,
[intopostion] [varchar]  (1) NULL,
[listcount] [int]  NULL,
[team] [varchar]  (50) NULL,
[zg] [varchar]  (1) NULL,
[mrorder] [varchar]  (50) NULL,
[safe] [int]  NULL,
[tempDept] [int]  NULL)

ALTER TABLE [Reg] WITH NOCHECK ADD  CONSTRAINT [PK_Reg] PRIMARY KEY  NONCLUSTERED ( [id] )

if exists (select * from sysobjects where id = OBJECT_ID('[Relevance]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [Relevance]

CREATE TABLE [Relevance] (
[ID] [int]  IDENTITY (1, 1)  NOT NULL,
[SoureID] [int]  NOT NULL,
[TargetID] [int]  NOT NULL,
[Type] [int]  NOT NULL,
[Remark] [varchar]  (255) NULL)

ALTER TABLE [Relevance] WITH NOCHECK ADD  CONSTRAINT [PK_Relevance] PRIMARY KEY  NONCLUSTERED ( [ID] )

if exists (select * from sysobjects where id = OBJECT_ID('[Role]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [Role]

CREATE TABLE [Role] (
[id] [int]  IDENTITY (1, 1)  NOT NULL,
[RoleNo] [varchar]  (20) NULL,
[RoleName] [varchar]  (50) NULL,
[limit1] [varchar]  (1) NULL,
[limit2] [varchar]  (1) NULL,
[limit3] [varchar]  (1) NULL,
[limit4] [varchar]  (1) NULL,
[limit5] [varchar]  (1) NULL,
[limit6] [varchar]  (1) NULL,
[limit7] [varchar]  (1) NULL,
[limit8] [varchar]  (1) NULL,
[limit9] [varchar]  (1) NULL,
[limit10] [varchar]  (1) NULL,
[limit11] [varchar]  (1) NULL,
[limit12] [varchar]  (1) NULL,
[limit13] [varchar]  (1) NULL,
[limit14] [varchar]  (1) NULL)

SET IDENTITY_INSERT [Role] ON

INSERT [Role] ([id],[RoleNo],[RoleName]) VALUES ( 1,N'1',N'教师')
INSERT [Role] ([id],[RoleNo],[RoleName]) VALUES ( 2,N'2',N'学生')
INSERT [Role] ([id],[RoleNo],[RoleName]) VALUES ( 3,N'3',N'管理')

SET IDENTITY_INSERT [Role] OFF
if exists (select * from sysobjects where id = OBJECT_ID('[Safe]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [Safe]

CREATE TABLE [Safe] (
[id] [int]  IDENTITY (1, 1)  NOT NULL,
[dj] [varchar]  (50) NULL,
[pic] [varchar]  (50) NULL,
[od] [int]  NULL)

SET IDENTITY_INSERT [Safe] ON

INSERT [Safe] ([id],[dj],[od]) VALUES ( 1,N'普通',1)
INSERT [Safe] ([id],[dj],[od]) VALUES ( 3,N'保密',2)
INSERT [Safe] ([id],[dj],[od]) VALUES ( 4,N'机密',3)
INSERT [Safe] ([id],[dj],[od]) VALUES ( 5,N'绝密',4)

SET IDENTITY_INSERT [Safe] OFF
if exists (select * from sysobjects where id = OBJECT_ID('[Style]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [Style]

CREATE TABLE [Style] (
[id] [int]  IDENTITY (1, 1)  NOT NULL,
[pic] [varchar]  (100) NULL,
[title] [varchar]  (100) NULL,
[path] [varchar]  (100) NULL,
[show] [varchar]  (1) NULL,
[mr] [varchar]  (1) NULL)

ALTER TABLE [Style] WITH NOCHECK ADD  CONSTRAINT [PK_Style] PRIMARY KEY  NONCLUSTERED ( [id] )
SET IDENTITY_INSERT [Style] ON

INSERT [Style] ([id],[pic],[title],[path],[show]) VALUES ( 1,N'style/gray/style.gif',N'灰白空间',N'style/gray/style.css',N'1')
INSERT [Style] ([id],[pic],[title],[path],[show],[mr]) VALUES ( 2,N'style/blue/style.gif',N'蓝色天空',N'style/blue/style.css',N'1',N'1')
INSERT [Style] ([id],[pic],[title],[path],[show]) VALUES ( 3,N'style/green/style.gif',N'青青河草',N'style/green/style.css',N'1')
INSERT [Style] ([id],[pic],[title],[path],[show]) VALUES ( 4,N'style/red/style.gif',N'橘子红了',N'style/red/style.css',N'1')

SET IDENTITY_INSERT [Style] OFF
if exists (select * from sysobjects where id = OBJECT_ID('[Team]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [Team]

CREATE TABLE [Team] (
[id] [int]  IDENTITY (1, 1)  NOT NULL,
[Team] [varchar]  (50) NULL,
[TeamPath] [varchar]  (255) NULL,
[TeamMemo] [text]  NULL,
[TeamSpace] [int]  NULL)

ALTER TABLE [Team] WITH NOCHECK ADD  CONSTRAINT [PK_Team] PRIMARY KEY  NONCLUSTERED ( [id] )
SET IDENTITY_INSERT [Team] ON


SET IDENTITY_INSERT [Team] OFF
if exists (select * from sysobjects where id = OBJECT_ID('[template]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [template]

CREATE TABLE [template] (
[id] [int]  IDENTITY (1, 1)  NOT NULL,
[label] [varchar]  (50) NULL,
[note] [varchar]  (255) NULL,
[para] [varchar]  (255) NULL,
[content] [text]  NULL,
[type] [varchar]  (2) NULL)

ALTER TABLE [template] WITH NOCHECK ADD  CONSTRAINT [PK_template] PRIMARY KEY  NONCLUSTERED ( [id] )
SET IDENTITY_INSERT [template] ON

INSERT [template] ([id],[label],[note],[para],[content],[type]) VALUES ( 52,N'searchlist',N'搜索文件列表',N'LastTime|Desc,1,0,20,50,,0,,1,,0,-1,,1,0,',N'<tr><td width="13%" class="gray">[{$kind}]</td><td width="59%" align="left">{$ico} <a href="{$down}" class="gray" target=_blank>{$filename}</a></td><td width="16%" class="gray" align="left">{$time}</td><td width="12%" class="gray" align="left">{$size}</td></tr><tr><td colspan="4" class="gray">{$note}</td></tr><tr><td colspan="4" height=3px></td></tr>',N'1')
INSERT [template] ([id],[label],[note],[para],[content],[type]) VALUES ( 53,N'userRankList',N'用户排行',N'regdate|ASC,0,6,6,0,,0,,0,1,',N'<li class="num{$num}"><a href="ResourceMng.aspx?username={$username}" target="_blank">{$username}</a><span><strong>{$fn}</strong>份文档</span></li>',N'2')
INSERT [template] ([id],[label],[note],[para],[content],[type]) VALUES ( 54,N'Default_GG',N'首页显示的公告',N'0,10,10,',N'<li>● <a href="#" target="_blank">{$title}</a></li>',N'4')
INSERT [template] ([id],[label],[note],[para],[content],[type]) VALUES ( 55,N'hotestKJZY',N'热门课件资源',N'LastTime|Desc,0,0,8,14,,0,,0,,0,0,0,0,1,and a.zykind=(select id from zy where kind="课件"),',N'<li><a href="resourceDetail.aspx?fileid={$fileId}" target="_blank"><img src="{$path}" /><br>{$filename}</a></li>',N'1')
INSERT [template] ([id],[label],[note],[para],[content],[type]) VALUES ( 56,N'recommendSourceList',N'推荐资源',N'LastTime|Desc,0,0,8,14,,0,,0,,0,0,0,0,1,',N'<li><a href="resourceDetail.aspx?fileid={$fileId}" target="_blank"><img src="{$path}" /><br>{$filename}</a></li>',N'1')
INSERT [template] ([id],[label],[note],[para],[content],[type]) VALUES ( 57,N'Default_NewFile2',N'首页最新关联文件',N'LastTime|DESC,0,0,7,15,,0,,0,,0,0,1,0,',N'<li>● <a href="resourceDetail.aspx?fileid={$fileId}" target="_blank">{$filename}</a></li>',N'1')
INSERT [template] ([id],[label],[note],[para],[content],[type]) VALUES ( 58,N'Default_NewFile3',N'首页最新关联文件图片',N'LastTime|Desc,0,0,8,4,,0,,0,,0,0,0,0,1,',N'<li class="img{$orderCount}"><img src="{$path}" /><p><a href="resourceDetail.aspx?fileid={$fileId}" target="_blank">{$filename}</a></p></li>',N'1')
INSERT [template] ([id],[label],[note],[para],[content],[type]) VALUES ( 59,N'Default_ShowZY3',N'首页最新关联资源文件图片',N'LastTime|Desc,0,3,2,14,,0,,0,,0,0,0,0,1,',N'<li class="img{$orderCount}"><a href="resourceDetail.aspx?fileid={$fileId}" target="_blank"><img src="{$path}" /><p>{$filename}</p></a></li>',N'1')
INSERT [template] ([id],[label],[note],[para],[content],[type]) VALUES ( 60,N'hotestZY',N'热门资源',N'Downcount|DESC,0,0,6,15,,0,,0,,0,0,1,0,0,',N'<li>● <a href="resourceDetail.aspx?fileid={$fileId}" target="_blank">{$filename}</a></li>',N'1')
INSERT [template] ([id],[label],[note],[para],[content],[type]) VALUES ( 61,N'Default_ShowZY2',N'首页最新关联资源文件',N'LastTime|DESC,0,0,10,15,,0,,0,,0,0,1,0,0,',N'<li>● <a href="resourceDetail.aspx?fileid={$fileId}" target="_blank">{$filename}</a></li>',N'1')

SET IDENTITY_INSERT [template] OFF


if exists (select * from sysobjects where id = OBJECT_ID('[topdir]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [topdir]

CREATE TABLE [topdir] (
[id] [int]  IDENTITY (1, 1)  NOT NULL,
[dirname] [varchar]  (50) NULL,
[dorder] [int]  NULL)

ALTER TABLE [topdir] WITH NOCHECK ADD  CONSTRAINT [PK_topdir] PRIMARY KEY  NONCLUSTERED ( [id] )

if exists (select * from sysobjects where id = OBJECT_ID('[UPTasks]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [UPTasks]

CREATE TABLE [UPTasks] (
[ID] [int]  IDENTITY (1, 1)  NOT NULL,
[Name] [nvarchar]  (255) NULL,
[Virual] [nvarchar]  (255) NULL,
[Suffix] [nvarchar]  (10) NULL,
[Size] [int]  NULL,
[Loaded] [int]  NULL,
[threads] [int]  NULL,
[SDate] [smalldatetime]  NULL,
[FDate] [smalldatetime]  NULL)

ALTER TABLE [UPTasks] WITH NOCHECK ADD  CONSTRAINT [PK_UPTasks] PRIMARY KEY  NONCLUSTERED ( [ID] )
SET IDENTITY_INSERT [UPTasks] ON


SET IDENTITY_INSERT [UPTasks] OFF
if exists (select * from sysobjects where id = OBJECT_ID('[Workgroup]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [Workgroup]

CREATE TABLE [Workgroup] (
[id] [int]  IDENTITY (1, 1)  NOT NULL,
[workgroup] [varchar]  (100) NULL,
[order] [int]  NULL)

ALTER TABLE [Workgroup] WITH NOCHECK ADD  CONSTRAINT [PK_Workgroup] PRIMARY KEY  NONCLUSTERED ( [id] )
SET IDENTITY_INSERT [Workgroup] ON

INSERT [Workgroup] ([id],[workgroup]) VALUES ( 1,N'语文组')
INSERT [Workgroup] ([id],[workgroup]) VALUES ( 2,N'数学组')
INSERT [Workgroup] ([id],[workgroup]) VALUES ( 3,N'英语组')
INSERT [Workgroup] ([id],[workgroup]) VALUES ( 4,N'物理组')
INSERT [Workgroup] ([id],[workgroup]) VALUES ( 5,N'化学组')
INSERT [Workgroup] ([id],[workgroup]) VALUES ( 6,N'地理组')
INSERT [Workgroup] ([id],[workgroup]) VALUES ( 7,N'历史组')
INSERT [Workgroup] ([id],[workgroup]) VALUES ( 8,N'办公室')

SET IDENTITY_INSERT [Workgroup] OFF
if exists (select * from sysobjects where id = OBJECT_ID('[zy]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [zy]

CREATE TABLE [zy] (
[id] [int]  IDENTITY (1, 1)  NOT NULL,
[kind] [varchar]  (50) NULL,
[korder] [int]  NULL,
[type] [varchar]  (1) NULL)

ALTER TABLE [zy] WITH NOCHECK ADD  CONSTRAINT [PK_zy] PRIMARY KEY  NONCLUSTERED ( [id] )
SET IDENTITY_INSERT [zy] ON

INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 1,N'教案',1,N'1')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 2,N'试卷',2,N'1')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 3,N'课件',3,N'1')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 4,N'论文',4,N'1')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 5,N'习题',5,N'1')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 6,N'多媒体资料',6,N'1')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 7,N'文本与例题',7,N'1')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 8,N'英语听力',8,N'1')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 9,N'其它',9,N'1')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 10,N'语文',1,N'2')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 11,N'数学',2,N'2')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 12,N'英语',3,N'2')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 13,N'化学',4,N'2')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 14,N'物理',5,N'2')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 15,N'历史',6,N'2')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 16,N'生物',7,N'2')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 17,N'政治',8,N'2')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 18,N'地理',9,N'2')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 19,N'人教新课标',1,N'3')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 20,N'人教大纲版',2,N'3')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 21,N'小一',1,N'4')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 22,N'小二',2,N'4')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 23,N'小三',3,N'4')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 24,N'小四',4,N'4')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 25,N'小五',5,N'4')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 26,N'小六',6,N'4')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 27,N'初一',1,N'4')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 28,N'初二',2,N'4')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 29,N'初三',3,N'4')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 30,N'高一',4,N'4')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 31,N'高二',5,N'4')
INSERT [zy] ([id],[kind],[korder],[type]) VALUES ( 32,N'高三',6,N'4')

SET IDENTITY_INSERT [zy] OFF
if exists (select * from sysobjects where id = OBJECT_ID('[zymenu]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [zymenu]

CREATE TABLE [zymenu] (
[id] [int]  IDENTITY (1, 1)  NOT NULL,
[ParentNodeId] [int]  NULL,
[Text] [varchar]  (100) NULL,
[OrderID] [int]  NULL,
[Depth] [int]  NULL)

SET IDENTITY_INSERT [zymenu] ON

INSERT [zymenu] ([id],[Text],[OrderID],[Depth]) VALUES ( 1,N'辅助读物',0,0)
INSERT [zymenu] ([id],[Text],[OrderID],[Depth]) VALUES ( 2,N'备课素材',0,0)
INSERT [zymenu] ([id],[ParentNodeId],[Text],[OrderID],[Depth]) VALUES ( 3,1,N'学习辅导',0,1)
INSERT [zymenu] ([id],[ParentNodeId],[Text],[OrderID],[Depth]) VALUES ( 4,2,N'课件资源',0,1)
INSERT [zymenu] ([id],[ParentNodeId],[Text],[OrderID],[Depth]) VALUES ( 5,2,N'教师培训',0,1)
INSERT [zymenu] ([id],[ParentNodeId],[Text],[OrderID],[Depth]) VALUES ( 6,4,N'参考资料',0,2)

SET IDENTITY_INSERT [zymenu] OFF
