declare @shortnum nvarchar(20); --定义变量
declare short_to_longnum cursor for --定义游标
select shortnum from tbl_phone_bind_relation;
open short_to_longnum; --打开游标
fetch next from short_to_longnum into @shortnum;
while @@fetch_status=0 --遍历游标
begin
update tbl_phone_bind_relation set [email=shortnum=]shortnum='0755'+@shortnum[/email];
fetch next from short_to_longnum into @shortnum;
end
CLOSE short_to_longnum; --关闭游标
DEALLOCATE short_to_longnum;--释放游标