CREATE TABLE [dbo].[StatusReason](
[StatusReasonID] [Int]  IDENTITY(1,1) NOT NULL ,
[StatusReasonName] [NVarChar] (255)  NULL ,
[StatusID] [Int]   NULL ,
[LockState] [Int]   NULL CONSTRAINT [DF_StatusReason_LockState]  DEFAULT (1),
[Orders] [Int]   NULL ,

CONSTRAINT [PK_StatusReason] PRIMARY KEY CLUSTERED 
(
	[StatusReasonID] ASC
))
GO


Alter Table [Reply] ADD [StatusReasonID] int
GO

Alter Table [Reply] ADD [StatusReasonName] VarChar(255)
GO

Alter Table [Potential] ADD [StatusReasonID] int
GO

Alter Table [Potential] ADD [StatusReasonName] VarChar(255)
GO


Alter Table [Sending] ADD [SchoolID] int CONSTRAINT [DF_Sending_SchoolID] Default (0)
GO

Alter Table [Sending] ADD [ClassID] int CONSTRAINT [DF_Sending_ClassID] Default (0)
GO


Alter Table [SendLog] ADD [SchoolID] int CONSTRAINT [DF_SendLog_SchoolID] Default (0)
GO

Alter Table [SendLog] ADD [ClassID] int CONSTRAINT [DF_SendLog_ClassID] Default (0)
GO

Alter Table [SendLog] ADD [ValidCount] int CONSTRAINT [DF_SendLog_ValidCount] Default (0)
GO

Alter Table [SendLog] ADD [BillingCount] int CONSTRAINT [DF_SendLog_BillingCount] Default (0)
GO

Alter Table [SendLog] ADD [Gangway] int CONSTRAINT [DF_SendLog_Gangway] Default (0)
GO


Update Sending set SchoolID = 0
GO

Update Sending set ClassID = 0
GO


Update SendLog set SchoolID = 0
GO

Update SendLog set ClassID = 0
GO

Update SendLog set ValidCount = 0
GO

Update SendLog set BillingCount = 0
GO

Update SendLog set Gangway = 0
GO


ALTER TABLE Sending ALTER COLUMN TargetNo VarChar(2000)
GO

ALTER TABLE SendLog ALTER COLUMN TargetNo VarChar(2000)
GO


Update DBInfo set DateAndTime='2013-10-04'
GO














