How to pass table variable data into a data flow in ssis

痞子三分冷 提交于 2019-12-12 03:33:11

问题


I wrote a code like this in execute sql task

Declare @tmpHistoricDriveSpace Table 
( Servername varchar(255), MachineName varchar(255), Drive char(2), FreeSpace_MB int) 
insert into @tmpHistoricDriveSpace (Drive, FreeSpace_MB) exec xp_fixeddrives

update @tmpHistoricDriveSpace 
set Servername = convert(varchar(225), 
SERVERPROPERTY('servername')),   
MachineName = convert(varchar(225), SERVERPROPERTY('MachineName'))

Select MachineName, Servername, Drive, Freespace_MB 
from @tmpHistoricDriveSpace

This looks good but I am unable to carry this result into data flow task in SSIS which I am using to populate into a table.

I am not liking the idea of creating a temp table on master database or just creating a new database for this task alone.

Any help is much appreciated.

Thanks

Please refer this link for previous discussion


回答1:


Instead of writing the code in execute sql task why can't you write it in OLE DB Source directly.

Thanks, Santhosh



来源:https://stackoverflow.com/questions/35735332/how-to-pass-table-variable-data-into-a-data-flow-in-ssis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!