In SSIS, Hoew to assign a value to the variable? -


i have sql query in have mentioned @result. want assign value of @result declared variable in execute sql task of dft. please assist me?

here query:

declare @result smallint  declare @value  smallint  begin  set @value = (select value                dbo.ldmstockintegritycheck                interfacename =  'i0180'               , filename = 'piz.ed.nbfs001.picsht.data.ldm') set @result = 0;  if (@value = 1) begin  select @result = count(*) dbo.ldmintegrityerrorlog  interfacename = 'i0180' , filename = 'piz.ed.nbfs001.picsht.data.ldm' ,  convert(varchar(10), datetime, 120) = convert(varchar(10), getdate(), 120); end   end 

if want output value of count query count(*) dbo.ldmintegrityerrorlog don't see importance of variable @result

declare @value  smallint  begin  set @value = (select value                dbo.ldmstockintegritycheck                interfacename =  'i0180'               , filename = 'piz.ed.nbfs001.picsht.data.ldm')  if (@value = 1) begin  select count(*) result dbo.ldmintegrityerrorlog  interfacename = 'i0180' , filename = 'piz.ed.nbfs001.picsht.data.ldm' ,  convert(varchar(10), datetime, 120) = convert(varchar(10), getdate(), 120); end  else select null result end 

remove variable @result in query

now create variable taskresult of data type int .map variable result above query.

enter image description here


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -