从 SSIS 包执行 SQL 文件 [英] Execute SQL files from SSIS package

查看:42
本文介绍了从 SSIS 包执行 SQL 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有很多 *.sql 脚本文件,我想将它们合并到我的 SSIS 包中.

I have a lot of *.sql script files and i want to incorporate them to my SSIS package.

是否可以将这些 *.sql 文件用作我的包上的 Select/Insert/Update/Create/Alter/Drop 语句的来源?

Is it possible to use these *.sql files as the source of Select/Insert/Update/Create/Alter/Drop statements on my package?

目标是在不修改包的情况下动态更改脚本.

The goal is to dynamically alter the scripts without modifying the package.

谢谢

推荐答案

您可以使用执行 SQL 任务,其中语句来自这些 sql 文件.例如,如果您在 foreach 循环中循环所有 *.sql 类型的文件,然后在您循环的文件连接上使用执行 SQL 任务,您应该能够毫无问题地运行所有这些 SQL 文件.(在执行 SQL 任务"编辑器的常规"窗格中更改 SQLSourceType)

You can use Execute SQL Task where the statements come from these sql files. For example if you loop all your files of *.sql type in a foreach loop, then use Execute SQL task on the file connection you're looping on, you should be able to run all these SQL files without any problems. (Change SQLSourceType in the General pane of the Execute SQL Task editor)

这篇关于从 SSIS 包执行 SQL 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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