--显示sql server现有的所有数据库
exec sp_helpdb

Sql常用语句(3)-LMLPHP

--查看数据表设置的约束

exec sp_helpconstraint SubjectType

Sql常用语句(3)-LMLPHP

--update select出来的结果集的字段
update QuestionToAnswer
set IsDel=1,Marker=15,MarkingTime=getdate()
where ID in
(select QTA.ID from QuestionToAnswer QTA --QTA.ID,QTA.StudentID,QTA.IsDel,QTA.Score
inner join TClassStudent TCS on QTA.StudentID=TCS.StudentID and QTA.IsDel=0 and TCS.IsDel=0
where QTA.QuestionID=52 and TClassID=9)
04-25 23:00