先将这个a.txt导入到一个临时表里..create table #t(username nvarchar(10))bulk insert #t from 'd:\a.txt'
with
(
rowterminator='\n'
)update u
set u.usepoint=u.usepoint+100
from 用户表 u
join #t t
on u.username=t.username
with
(
rowterminator='\n'
)update u
set u.usepoint=u.usepoint+100
from 用户表 u
join #t t
on u.username=t.username
a 字段为col001update pe_user
set userpoint = userpoint+100
where pe_user in (select col001 from a)
数据操作之前,请备份数据库先。
update pe_user
set userpoint = userpoint+100
where username in (select col001 from a)
update u
set u.usepoint=u.usepoint+100
from 用户表 u , #t t
where u.username=t.username
网址:http://www.5soba.com