SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [LeaveMessage](
	[MessageID] [int] IDENTITY(1,1) NOT NULL,
	[Category] [int] NULL,
	[ReceiveUser] [int] NULL CONSTRAINT [DF_LeaveMessage_ReceiveUser]  DEFAULT ((0)),
	[SendUser] [int] NULL CONSTRAINT [DF_LeaveMessage_SendUser]  DEFAULT ((0)),
	[Title] [nvarchar](100) NULL,
	[Contact] [nvarchar](50) NULL,
	[Email] [varchar](100) NULL,
	[QQ] [varchar](50) NULL,
	[Phone] [varchar](100) NULL,
	[WriteContent] [nvarchar](max) NULL,
	[CreateDate] [datetime] NULL CONSTRAINT [DF_LeaveMessage_CreateDate]  DEFAULT (getdate()),
	[IP] [varchar](50) NULL,
	[Remark] [nvarchar](50) NULL,
	[ReplyContent] [nvarchar](max) NULL,
	[ReplyDate] [datetime] NULL,
	[ReplyPerson] [nvarchar](50) NULL,
	[ViewStatus] [int] NULL CONSTRAINT [DF_LeaveMessage_ViewStatus]  DEFAULT ((1)),
	[ViewPerson] [nvarchar](50) NULL,
	[ViewDate] [datetime] NULL,
	[Status] [int] NULL CONSTRAINT [DF_LeaveMessage_Status]  DEFAULT ((0)),
	[Editor] [nvarchar](50) NULL,
 CONSTRAINT [PK_LeaveMessage] PRIMARY KEY CLUSTERED 
(
	[MessageID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET IDENTITY_INSERT [LeaveMessage] ON 

INSERT [LeaveMessage] ([MessageID], [Category], [ReceiveUser], [SendUser], [Title], [Contact], [Email], [QQ], [Phone], [WriteContent], [CreateDate], [IP], [Remark], [ReplyContent], [ReplyDate], [ReplyPerson], [ViewStatus], [ViewPerson], [ViewDate], [Status], [Editor]) VALUES (1, 0, 6, 0, NULL, N'332sfs', NULL, NULL, N'33223', N'xxxxxxxx', CAST(N'2013-10-21 23:26:40.190' AS DateTime), N'::1', N'', N'', CAST(N'2013-10-21 23:32:43.720' AS DateTime), N'', 1, N'管理员', CAST(N'2013-10-21 23:32:40.337' AS DateTime), 1, NULL)
INSERT [LeaveMessage] ([MessageID], [Category], [ReceiveUser], [SendUser], [Title], [Contact], [Email], [QQ], [Phone], [WriteContent], [CreateDate], [IP], [Remark], [ReplyContent], [ReplyDate], [ReplyPerson], [ViewStatus], [ViewPerson], [ViewDate], [Status], [Editor]) VALUES (2, 0, 0, NULL, N'ddasd', N'', N'', NULL, NULL, N'ddddddd', CAST(N'2013-12-27 23:54:53.683' AS DateTime), N'::1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
INSERT [LeaveMessage] ([MessageID], [Category], [ReceiveUser], [SendUser], [Title], [Contact], [Email], [QQ], [Phone], [WriteContent], [CreateDate], [IP], [Remark], [ReplyContent], [ReplyDate], [ReplyPerson], [ViewStatus], [ViewPerson], [ViewDate], [Status], [Editor]) VALUES (3, 0, 0, NULL, N'xxxxxxxxx', N'332', N'3322%40q.com', NULL, NULL, N'xxxxxxx', CAST(N'2013-12-27 23:55:05.170' AS DateTime), N'::1', N'', N'ddd', CAST(N'2013-12-29 17:37:25.447' AS DateTime), N'admin', 0, N'管理员', CAST(N'2013-12-27 23:59:09.200' AS DateTime), 1, NULL)
INSERT [LeaveMessage] ([MessageID], [Category], [ReceiveUser], [SendUser], [Title], [Contact], [Email], [QQ], [Phone], [WriteContent], [CreateDate], [IP], [Remark], [ReplyContent], [ReplyDate], [ReplyPerson], [ViewStatus], [ViewPerson], [ViewDate], [Status], [Editor]) VALUES (4, 0, 0, 6, N'', N'', N'', NULL, NULL, N'', CAST(N'2013-12-29 12:26:57.600' AS DateTime), N'::1', NULL, NULL, NULL, NULL, 1, NULL, NULL, 0, NULL)
INSERT [LeaveMessage] ([MessageID], [Category], [ReceiveUser], [SendUser], [Title], [Contact], [Email], [QQ], [Phone], [WriteContent], [CreateDate], [IP], [Remark], [ReplyContent], [ReplyDate], [ReplyPerson], [ViewStatus], [ViewPerson], [ViewDate], [Status], [Editor]) VALUES (5, 0, 0, 6, N'', N'', N'', NULL, NULL, N'', CAST(N'2013-12-29 12:27:00.890' AS DateTime), N'::1', NULL, NULL, NULL, NULL, 1, NULL, NULL, 0, NULL)
INSERT [LeaveMessage] ([MessageID], [Category], [ReceiveUser], [SendUser], [Title], [Contact], [Email], [QQ], [Phone], [WriteContent], [CreateDate], [IP], [Remark], [ReplyContent], [ReplyDate], [ReplyPerson], [ViewStatus], [ViewPerson], [ViewDate], [Status], [Editor]) VALUES (6, 0, 0, 6, N'', N'', N'', NULL, NULL, N'', CAST(N'2013-12-29 12:27:01.077' AS DateTime), N'::1', NULL, NULL, NULL, NULL, 0, N'管理员', CAST(N'2013-12-29 17:36:27.397' AS DateTime), 0, NULL)
INSERT [LeaveMessage] ([MessageID], [Category], [ReceiveUser], [SendUser], [Title], [Contact], [Email], [QQ], [Phone], [WriteContent], [CreateDate], [IP], [Remark], [ReplyContent], [ReplyDate], [ReplyPerson], [ViewStatus], [ViewPerson], [ViewDate], [Status], [Editor]) VALUES (7, 0, 0, 1, N'fds', N'', N'', NULL, NULL, N'sggfsdgds', CAST(N'2014-12-21 15:29:52.153' AS DateTime), N'::1', NULL, NULL, NULL, NULL, 0, N'管理员', CAST(N'2014-12-21 15:30:47.653' AS DateTime), 0, NULL)
SET IDENTITY_INSERT [LeaveMessage] OFF
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'可选,类别' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LeaveMessage', @level2type=N'COLUMN',@level2name=N'Category'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'可选,接收用户ID,如果为0(默认)即本站留言' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LeaveMessage', @level2type=N'COLUMN',@level2name=N'ReceiveUser'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'可选,发生留言的用户ID,匿名用户为0' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LeaveMessage', @level2type=N'COLUMN',@level2name=N'SendUser'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'可选,标题/主题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LeaveMessage', @level2type=N'COLUMN',@level2name=N'Title'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'可选,联系人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LeaveMessage', @level2type=N'COLUMN',@level2name=N'Contact'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'联系方式' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LeaveMessage', @level2type=N'COLUMN',@level2name=N'Email'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'留言内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LeaveMessage', @level2type=N'COLUMN',@level2name=N'WriteContent'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LeaveMessage', @level2type=N'COLUMN',@level2name=N'CreateDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'回复内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LeaveMessage', @level2type=N'COLUMN',@level2name=N'ReplyContent'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'回复时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LeaveMessage', @level2type=N'COLUMN',@level2name=N'ReplyDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'回复人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LeaveMessage', @level2type=N'COLUMN',@level2name=N'ReplyPerson'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'可选,消息查看状态,1未查看(默认),0已查看' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LeaveMessage', @level2type=N'COLUMN',@level2name=N'ViewStatus'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'可选,消息查看人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LeaveMessage', @level2type=N'COLUMN',@level2name=N'ViewPerson'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'可选,消息被查看时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LeaveMessage', @level2type=N'COLUMN',@level2name=N'ViewDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态,1显示,0隐藏(默认)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LeaveMessage', @level2type=N'COLUMN',@level2name=N'Status'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编辑人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LeaveMessage', @level2type=N'COLUMN',@level2name=N'Editor'
GO
