CREATE TABLE [dbo].[StuPoints](
[StuPointsID] [Int]  IDENTITY(1,1) NOT NULL ,
[StudentID] [Int]   NULL ,
[Points] [Int]   NULL ,
[DateAndTime] [DateTime]   NULL ,
[Remark] [NVarChar] (100)  NULL ,
[UserID] [Int]   NULL ,
[TrueName] [NVarChar] (50)  NULL ,
[InsertTime] [DateTime]   NULL CONSTRAINT [DF_StuPoints_InsertTime]  DEFAULT (getdate()),

CONSTRAINT [PK_StuPoints] PRIMARY KEY CLUSTERED 
(
	[StuPointsID] ASC
))
GO

Alter Table [StuReply] ADD [NextReplyDate] [DateTime]
GO

Insert into Reminder(ReminderID,Title,Message,CountSql,ContentSql,NavigateUrl,Target,LockState,Remark,Orders,Allow,GroupAndUsers)
values(6,'学员关怀提醒','有{0}名学员需要关怀。','Select Count(*) from StuReply where 
NextReplyDate <=  GetDate()
and UserID = {@UserID} ','Select 
StuReply.StudentID as 学号,
Student.StudentName as 姓名,
StuReply.DateAndTime as 上次关怀日期,
StuReply.Content as 上次关怀内容
from StuReply,Student where 
StuReply.StudentID = Student.StudentID
and StuReply.NextReplyDate <=  GetDate()
and StuReply.UserID = {@UserID} ','','_blank',1,'',6,0,'')
GO

Update DBInfo set DateAndTime='2012-05-15'
GO