码迷,mamicode.com
首页 > 数据库 > 详细

Sql Server数据批量更新

时间:2017-03-07 19:31:31      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:批量   sql   log   blog   date   server   数据   from   select   

UPDATE S SET S.[name]=T.[name],S.[sch_id]=T.[sch_id],S.[sex]=T.[sex],S.[isOk]=T.[isOk] FROM [Student] S INNER JOIN 
            (
              SELECT 
1010 AS id,小妹1130946325 AS name,2 AS sch_id,gril AS sex,0 AS isOk UNION ALL 
SELECT 
1011 AS id,小子1130946325 AS name,3 AS sch_id,boy AS sex,1 AS isOk

            ) T  ON T.[id]=S.[id]

 

Sql Server数据批量更新

标签:批量   sql   log   blog   date   server   数据   from   select   

原文地址:http://www.cnblogs.com/gaocong/p/6516112.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!