Sql-exec

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

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

exec sp_helpconstraint SubjectType

--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)
posted @ 2016-10-20 11:06  zhyue93  阅读(643)  评论(0编辑  收藏  举报