SSIS - 如何在运行时设置平面文件源路径 [英] SSIS - How to set a flat file source path at run time

查看:424
本文介绍了SSIS - 如何在运行时设置平面文件源路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常简单的dtsx包,我创建了一个名为pSourceFilePath的包参数,并将其连接字符串设置为本地磁盘上的路径。 我"参数化"了平面文件连接管理器的连接字符串,并将其设置为
以指向参数(pSourceFilePath)。 当我在Visual Studio中运行它时,一切都很好。


但是当我从ac#Winforms应用程序运行它时(在我将SSIS包部署到SQL Server之后),我设置了一个包参数平面文件的路径我希望包用作处理的数据输入。问题是:包ALWAYS使用平面文件连接管理器中设计时定义的值
,而不是我在C#程序中动态设置并传入的pSourceFilePath参数值。


如何让软件包使用参数值?


这是使用SQL Server 2017和Visual Studio 2017(Winforms应用程序)。

解决方案

https://social.msdn.microsoft.com/Forums/office/en-US/3e7a729f -7074-43d5-a6a3-461b8b4ef061 / how-to-create-a-dynamic-flat-file-source-without-specified-a-path?forum = sqlintegrationservices


https://www.mssqltips.com/ sqlservertip / 1084 /动态平音响le-connections-in-sql-server-integration-services /



从文件夹获取
任何平面文件源并将名称缓存为超级全局变量




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).

解决方案

https://social.msdn.microsoft.com/Forums/office/en-US/3e7a729f-7074-43d5-a6a3-461b8b4ef061/how-to-create-a-dynamic-flat-file-source-without-specify-a-path?forum=sqlintegrationservices

https://www.mssqltips.com/sqlservertip/1084/dynamic-flat-file-connections-in-sql-server-integration-services/

Get any flat file source from folder and cache the name as a super global variable


这篇关于SSIS - 如何在运行时设置平面文件源路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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