dcsimg


CREATE TABLE [dbo].[messages] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[sender] [varchar] (50) NOT NULL , 
        [recipient] [varchar] (80) NOT NULL , 
	[subject] [varchar] (128) NULL ,
        [body] [varchar] (6600) NULL ,   
	[attachment] [varchar] (128) NULL ,
	[query] [varchar] (1000) NULL ,
	[sentStatus] [int] NULL DEFAULT 0,
	[sentDate] [datetime] NULL ,
	[createDate] [datetime] NULL DEFAULT (getdate()),
	CONSTRAINT [PK_messages] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) )
GO
CREATE INDEX IDX_messages_sender
	ON messages (sender)
GO

CREATE INDEX IDX_messages_recipient
	ON messages (recipient)
GO

CREATE INDEX IDX_messages_sentStatus
	ON messages (sentStatus)
GO