if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[T_MailFolder]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[T_MailFolder]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[T_MailUser]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[T_MailUser]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[T_Mails]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[T_Mails]
GO
CREATE TABLE [dbo].[T_MailFolder] (
[ID] [int] IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL ,
[UserID] [varchar] (250) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[FolderName] [varchar] (250) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[MailCount] [int] NOT NULL ,
[UnReadCount] [int] NOT NULL ,
[TotalSize] [bigint] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[T_MailUser] (
[ID] [int] IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL ,
[UserID] [varchar] (250) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[Password] [varchar] (250) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[Roles] [text] COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[T_Mails] (
[ID] [bigint] IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL ,
[UserID] [varchar] (250) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[Uidl] [varchar] (250) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[MessageID] [varchar] (500) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[IsRead] [tinyint] NOT NULL ,
[Folder] [varchar] (250) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[IndexOnServer] [int] NOT NULL ,
[MailSize] [bigint] NOT NULL ,
[MailDate] [varchar] (250) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[MailFrom] [varchar] (250) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[MailTo] [varchar] (250) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[CC] [text] COLLATE Chinese_PRC_CI_AS NULL ,
[Subject] [text] COLLATE Chinese_PRC_CI_AS NULL ,
[Content] [text] COLLATE Chinese_PRC_CI_AS NULL ,
[Attachments] [text] COLLATE Chinese_PRC_CI_AS NULL ,
[SourceCode] [text] COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
评论0