sql server 建临时表修改数据
时间:2010-11-22 来源:舍予
/********************MC_User即为用户信息表************************/
declare @count int
declare @index int
declare @tmpID int
declare @tmpUserPassword nvarchar(50)
declare @tmpTable table
(
Inde int identity(1,1),
ID int,
UserPassword nvarchar(50)
)
insert into @tmpTable select a.ID,a.UserPassword from MC_User a
set @count=@@ROWCOUNT
set @index=1
while @index<=@count
begin
select @tmpID= ID,@tmpUserPassword= UserPassword from @tmpTable where Inde=@index
update MC_User set UserPassword=UPPER(@tmpUserPassword)
where ID=@tmpID
set @index=@index+1
end
相关阅读 更多 +