问题
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