
if (select object_id('DF_BillItem_CourseProgress')) is null
Alter table [BillItem] add constraint DF_BillItem_CourseProgress DEFAULT ((0)) for CourseProgress
GO

if (select object_id('DF_BillItem_BackAmount')) is null
Alter table [BillItem] add constraint DF_BillItem_BackAmount DEFAULT ((0)) for BackAmount
GO

if (select object_id('DF_BillItem_ContinueReg')) is null
Alter table [BillItem] add constraint DF_BillItem_ContinueReg DEFAULT ((0)) for ContinueReg
GO

Update [BillItem] set [CourseProgress] = 0 where [CourseProgress] is null
GO

Update [BillItem] set [BackAmount] = 0 where [BackAmount] is null
GO

Update [BillItem] set [ContinueReg] = 0 where [ContinueReg] is null
GO

Update [StuClass] set [ContinueReg] = 2 where [ContinueReg] = 1
GO

Update [StuClass] set [ContinueReg] = 1 where [ContinueReg] = 0
GO

Update DBInfo set DateAndTime='2011-11-08'
GO

