Update BillItem set DealWithState = 1 where ProductType = 8 and DealWithState = 0
GO

CREATE TABLE [dbo].[Score](
[ScoreID] [Int]  IDENTITY(1,1) NOT NULL ,
[ScoreName] [NVarChar] (255)  NULL ,
[DateAndTime] [DateTime]   NULL ,
[Score] [Decimal] (18,2)  NULL CONSTRAINT [DF_Score_Score]  DEFAULT (0),
[Remark] [NVarChar] (255)  NULL ,
[StuClassID] [Int]   NULL ,
[Orders] [Int]   NULL ,

CONSTRAINT [PK_Score] PRIMARY KEY CLUSTERED 
(
	[ScoreID] ASC
))
GO

Update DataSet set  [Content]='
table:Bill
cmd: Select * from Bill where BillID = @BillID 
go

table:BillItem
cmd: Select * from BillItem where BillID = @BillID 
go

table:Student
cmd: Select Student.* from Student,Bill where Student.StudentID = Bill.StudentID and Bill.BillID = @BillID 
go

table:StuClass
cmd: Select StuClass.* from StuClass,BillItem where StuClass.BillItemID = BillItem.BillItemID and BillItem.BillID= @BillID 
go

table:Class
cmd: Select Class.*,StuClass.StuClassID from StuClass,BillItem,Class where StuClass.BillItemID = BillItem.BillItemID and StuClass.ClassID = Class.ClassID and BillItem.BillID= @BillID 
go

table:School
cmd: Select School.SchoolID,School.SchoolName,School.Tel,School.Address from School,Bill where School.SchoolID = Bill.PostSchoolID and Bill.BillID = @BillID 
go
' where DataSetID = 4
GO

Update DBInfo set DateAndTime='2014-09-03'
GO












