select sample_value,Sample_GUID,row_number() over(order by sample_value )as rownumber into  #AATemp   ------建立临时表
from [ZJJK].[dbo].[bus_report_Sample_source]  -----从哪张表查询到的数据
declare @i int ,@count int,@sample_value decimal(10,5),@Sample_GUID char(32)   -----定义变量
set @i=1
select @count=max(rownumber) from #AATemp
while @i<@count
begin     ----开始循环修改
select @sample_value=sample_value,@Sample_GUID=Sample_GUID from  #AATemp
update [ZJFoodborne].[dbo].[BusSamples]     -----要修改的表
set Sample_Counts=@sample_value       -----要修改的字段名称
where Sample_GUID=@Sample_GUID     -----条件
set @i=@i+1  
end

相关文章:

  • 2021-12-15
  • 2022-12-23
  • 2022-12-23
  • 2021-06-14
  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-21
  • 2021-08-26
  • 2021-07-11
  • 2022-12-23
  • 2022-12-23
  • 2021-05-16
  • 2021-11-20
相关资源
相似解决方案