简体   繁体   English

SSIS:使用变量作为平面文件目标的名称

[英]SSIS : Using a variable as the name of a flat file destination

I have an SSIS solution where depending on a parameter, it launches the extraction of different databases, each in a different file, and the name must contain the date of the extraction so we can't hard code the name in the Destination wizard, I must use a variable where I concatenate the date to a file name, and I have to use that variable as the file name.我有一个 SSIS 解决方案,它根据参数启动不同数据库的提取,每个数据库在不同的文件中,并且名称必须包含提取日期,因此我们不能在目标向导中硬编码名称,我必须使用将日期连接到文件名的变量,并且必须使用该变量作为文件名。 But the destination wizard only seems to let me write plain text.但是目标向导似乎只让我写纯文本。

在此处输入图片说明

Any idea how I can do this ?知道我该怎么做吗?

Select the connection manager in the Connection managers bar.在连接管理器栏中选择连接管理器。 Go to the Properties Pane and find the "expressions" option.转到“属性”窗格并找到“表达式”选项。 Click the ellipsis in the adjacent blank window to open a new window.单击相邻空白窗口中的省略号以打开一个新窗口。

Find "File Name" or "Connection String" in the drop down, and then in the expression, put the name of your variable.在下拉列表中找到“文件名”或“连接字符串”,然后在表达式中输入变量的名称。

If the file may not exist before the package is run, ensure you enable delay validation on the connection manager too.如果在运行包之前该文件可能不存在,请确保您也在连接管理器上启用延迟验证。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM