如何将表变量数据传递到ssis中的数据流中 [英] How to pass table variable data into a data flow in ssis

查看:25
本文介绍了如何将表变量数据传递到ssis中的数据流中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在execute sql task中写了这样一段代码

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

这看起来不错,但我无法将此结果带入 SSIS 中的数据流任务,我正在使用该任务填充表格.

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.

我不喜欢在 master 数据库上创建临时表或仅为此任务创建一个新数据库的想法.

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

非常感谢任何帮助.

谢谢

请参考此链接进行之前的讨论

推荐答案

不是在execute sql任务中写代码,为什么不能直接在OLE DB Source中写.

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

谢谢,桑托斯

这篇关于如何将表变量数据传递到ssis中的数据流中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆