SSIS - 如何在运行时设置平面文件源路径 [英] SSIS - How to set a flat file source path at run time
问题描述
我有一个非常简单的dtsx包,我创建了一个名为pSourceFilePath的包参数,并将其连接字符串设置为本地磁盘上的路径。 我"参数化"了平面文件连接管理器的连接字符串,并将其设置为
以指向参数(pSourceFilePath)。 当我在Visual Studio中运行它时,一切都很好。
但是当我从ac#Winforms应用程序运行它时(在我将SSIS包部署到SQL Server之后),我设置了一个包参数平面文件的路径我希望包用作处理的数据输入。问题是:包ALWAYS使用平面文件连接管理器中设计时定义的值
,而不是我在C#程序中动态设置并传入的pSourceFilePath参数值。
如何让软件包使用参数值?
这是使用SQL Server 2017和Visual Studio 2017(Winforms应用程序)。
从文件夹获取
任何平面文件源并将名称缓存为超级全局变量
I have a very simple dtsx package where I created a package parameter called pSourceFilePath and I set its connection string to a path on a local disk. I "parameterized" the connection string for the flat file connection manager and set it to point to the parameter (pSourceFilePath). Everything works great when I run it in Visual Studio.
But when I run it from a c# Winforms app (after I deploy the SSIS package to SQL Server), I set a package parameter with the path of the flat file I want the package to use as the data input for processing. The problem is: the package ALWAYS uses the value defined at design time in the flat file connection manager and not the pSourceFilePath parameter value that I set dynamically in my C# program and passed in.
How can I get the package to use the parameter value?
This is using SQL Server 2017 and Visual Studio 2017 (Winforms application).
Get any flat file source from folder and cache the name as a super global variable
这篇关于SSIS - 如何在运行时设置平面文件源路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!