学习笔记

来源:互联网 发布:淘宝京东天猫哪个好 编辑:程序博客网 时间:2024/06/05 22:50

************把一个表中的一个字段的值插入到另一个表中的某个字段里******************

表sheet

-------------------

ID     int  

 

a       varchar

--------------------

 

/************************************************************************/ 

 

declare @N int
set @N=1
while @N<102
begin
update ServiceStationInfo set CountyName=(select a from Sheet where ID=@N) where CountyID=@N
set @N=@N+1
end

/************************************************************************/