拼SQL
declare @sql nvarchar(4000)
set @sql=''
select @sql = @sql+'update aa set status=1' + code +' aaa ' from area where code in ('101','101101')
select @sql
拼SQL
declare @sql nvarchar(4000)
set @sql=''
select @sql = @sql+'update aa set status=1' + code +' aaa ' from area where code in ('101','101101')
select @sql