首页 > 代码库 > Sql Server数据批量更新

Sql Server数据批量更新

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数据批量更新