批量修改。

CREATE TABLE Student (  ID int primary key identity,  Name nvarchar(50) not null,  Age int not null )

CREATE TABLE Student_Temp (  ID int primary key,  Name nvarchar(50) not null,  Age int not null )

--复制数据

INSERT INTO Student_Temp(ID,Name,Age) SELECT ID,Name,Age FROM Student WHERE ID IN (1,2,3)

UPDATE Student SET Name = B.Name FROM Student A INNER JOIN Student_Temp B ON A.ID = B.ID

 

posted @ 2012-09-21 15:51  pnljs  阅读(144)  评论(0编辑  收藏  举报