在SSIS构建或签入后执行SQL脚本 [英] Execute SQL script after SSIS build or check-in

查看:144
本文介绍了在SSIS构建或签入后执行SQL脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试找到一种更好的方法来测试我们的SSIS应用程序,该应用程序用于将文件中的数据加载到SQL Server中并验证文件数据.

I am trying to find a better way to test our SSIS application, which is used to load data from a file into SQL Server and validate the file data.

我已经创建了一个SQL脚本,可以运行该脚本以将不良"数据插入数据库表中,并确保我们的验证正确执行.

I have created a SQL script which can be run to insert 'bad' data into the database tables, and ensure that our validations are performing correctly.

SQL脚本:
-加载错误"数据
-执行SSIS验证
-确保检测到数据中的错误
-输出通过或失败
-如果通过了,则删除TEST数据

The SQL script:
- loads 'bad' data
- executes the SSIS validations
- ensures the errors in the data were detected
- Outputs a PASS or FAIL
- Deletes the TEST data if passed

无论如何,我是否可以使该脚本以某种方式自动运行,例如在有人检入某些代码之后?我应该将其添加为存储过程吗?

Is there anyway I can get this script to be run automatically somehow, for example after someone checks in some code? Should I add it as a stored proc?

我看了Default template Build定义,但看不到如何运行此SQL脚本.

I had a look at the Default template Build definition but I couldn't see how to run this SQL script.

推荐答案

根据我2分钟的搜索记录,您似乎无法将其作为签入的一部分.

It doesn't appear that you can do it as part of a checkin based on my 2 minutes of searching.

  • How to modify the default Check-in Action in TFS?
  • http://msdn.microsoft.com/en-us/library/ms243849(VS.80).aspx
  • Can I modify the default Check-in Action in TFS 2012? (pretty picture)
  • http://www.codeproject.com/Tips/562994/Perform-a-custom-action-for-Check-in-event-in-Micr

相反,您需要设置构建服务器来处理该操作.开箱即用,MSBuild无法运行SQL脚本,因此您需要使用 MSBuild扩展打包并利用SqlExecute

Instead, you'll need to set up a build server to handle the action. Out of the box, MSBuild doesn't have the ability to run a SQL Script so you'll need to snag the MSBuild Extension Pack and leverage SqlExecute

  • http://msdn.microsoft.com/en-us/library/ms181712.aspx
  • http://msdn.microsoft.com/en-us/library/ms181710(v=vs.90).aspx
  • http://msdn.microsoft.com/en-us/library/cc668755(v=vs.90).aspx
  • http://www.msbuildextensionpack.com/help/4.0.5.0/html/0d864b98-649a-5454-76ea-bd3069fde8bd.htm

这篇关于在SSIS构建或签入后执行SQL脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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