SSIS与变量excel连接管理器 [英] SSIS with variable excel connection manager

查看:476
本文介绍了SSIS与变量excel连接管理器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用SSIS中的WMI事件观察器任务执行自动包。我想要的功能是将excel文件放入某个文件夹时自动执行程序包。但是,这些excel文件将是用于填充数据库的连接管理器。



目前SSIS不允许我这样做,因为我的excel连接管理器没有路径我运行该程序,只有文件被放在文件夹中才存在。



有没有一种方法可以让变量excel连接管理器或连接字符串的值一个变量?



另外,如何在表达式中实现此变量的用法?

解决方案

您可以使用一个变量作为您的excel源的连接字符串:


  1. 点击您的Connection Manager您的excel源

  2. 在属性窗口中,添加一个表达式(1)ConnectionString(2)并分配一个变量(3)



有很多不同的事情你可以用variabl做ES。每个循环容器和文件系统任务一起使用它们与组合使用。你通常会这样做


  1. 在变量窗口中创建一个变量

  2. 设置静态值或一个在包流程中被改变

  3. 将变量映射到表达式

有网络上的一些howtos,也许可以看看这个以获得温暖:



http://www.simple-talk.com/sql/ssis/working-with-variables-in -sql-server-integration-services /



http://www.rafael-salas.com/2007/03/ssis-file-system-task-move-and-rename .html


I am trying to do automatic package execution with a WMI Event Watcher Task within SSIS. The functionality I want is automatic package execution when excel files are dropped into a certain folder. However, these excel files will be the connection managers for populating a database.

Currently SSIS will not allow me to do this because my excel connection manager does not have a path when I run the program, and only exists once the files are dropped in the folder.

Is there a way for variable excel connection managers or the value of the connection string to be a variable?

Also, how do I implement the usage of this variable in an expression?

解决方案

You can use a variable for the connection string of you excel source:

  1. Click on your Connection manager of your excel source
  2. In properties window, add an expression(1) ConnectionString(2) and assign a variable(3)

There are alot of different things you can do with variables. They are used alot in combination with for each loop containers and file system tasks. Your normally do something like this

  1. create a variable in variable window
  2. Set a static value or one that gets changed during the package flow
  3. Map the variable to an expression

There are alot howtos on the web, maybe have a look at this to get warm with it:

http://www.simple-talk.com/sql/ssis/working-with-variables-in-sql-server-integration-services/

http://www.rafael-salas.com/2007/03/ssis-file-system-task-move-and-rename.html

这篇关于SSIS与变量excel连接管理器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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