SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [MessageOutbox](
	[MessageID] [int] IDENTITY(1,1) NOT NULL,
	[Type] [int] NULL CONSTRAINT [DF_OnlineMessage_Type]  DEFAULT ((0)),
	[SendID] [int] NULL CONSTRAINT [DF_OnlineMessage_SendID]  DEFAULT ((0)),
	[ReceiveID] [int] NULL CONSTRAINT [DF_OnlineMessage_ReceiveID]  DEFAULT ((0)),
	[MessageTitle] [nvarchar](100) NULL,
	[MessageContent] [text] NULL,
	[CreateTime] [datetime] NULL CONSTRAINT [DF_OnlineMessage_CreateTime]  DEFAULT (getdate()),
	[ExpirationTime] [datetime] NULL,
	[SendIP] [varchar](50) NULL,
	[MessageStatus] [int] NULL CONSTRAINT [DF_OnlineMessage_MessageStatus]  DEFAULT ((0)),
	[Remark] [nvarchar](50) NULL,
 CONSTRAINT [PK_Message] 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 [MessageOutbox] ON 

INSERT [MessageOutbox] ([MessageID], [Type], [SendID], [ReceiveID], [MessageTitle], [MessageContent], [CreateTime], [ExpirationTime], [SendIP], [MessageStatus], [Remark]) VALUES (1, 11, 0, 0, NULL, N'dasfdaf', CAST(N'2014-11-26 22:55:02.017' AS DateTime), NULL, N'::1', 0, NULL)
INSERT [MessageOutbox] ([MessageID], [Type], [SendID], [ReceiveID], [MessageTitle], [MessageContent], [CreateTime], [ExpirationTime], [SendIP], [MessageStatus], [Remark]) VALUES (2, 10, 0, 0, NULL, N'网站公告公告公告', CAST(N'2014-11-27 17:28:51.603' AS DateTime), NULL, N'::1', 0, NULL)
SET IDENTITY_INSERT [MessageOutbox] OFF
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'消息id,自增长编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MessageOutbox', @level2type=N'COLUMN',@level2name=N'MessageID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'消息类型,0-9系统类(0推向后台消息,1推向用户消息);10-19管理员类(10公告, 11群发消息,12向用户推送的消息);20-29用户类(20留言,21用户向管理员,22用户对用户)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MessageOutbox', @level2type=N'COLUMN',@level2name=N'Type'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'发送者ID,0为系统发出' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MessageOutbox', @level2type=N'COLUMN',@level2name=N'SendID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'接收者ID,0为非指定的对象' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MessageOutbox', @level2type=N'COLUMN',@level2name=N'ReceiveID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'消息标题,备用' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MessageOutbox', @level2type=N'COLUMN',@level2name=N'MessageTitle'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'消息内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MessageOutbox', @level2type=N'COLUMN',@level2name=N'MessageContent'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'消息创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MessageOutbox', @level2type=N'COLUMN',@level2name=N'CreateTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'消息过期时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MessageOutbox', @level2type=N'COLUMN',@level2name=N'ExpirationTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'可选,发送者Ip地址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MessageOutbox', @level2type=N'COLUMN',@level2name=N'SendIP'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'消息状态,-1删除，0正常(默认)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MessageOutbox', @level2type=N'COLUMN',@level2name=N'MessageStatus'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MessageOutbox', @level2type=N'COLUMN',@level2name=N'Remark'
GO
