需要在部署期间运行大量SQL数据脚本的有效方法 [英] Need efficient way to run large number of SQL data scripts during deployment

查看:60
本文介绍了需要在部署期间运行大量SQL数据脚本的有效方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将使用TFS 2015将SQL DB项目部署到多个服务器和数据库。我需要在每次部署中运行大量(即大约1,000个)数据脚本。  

I'm going to be deploying a SQL DB project to multiple servers and databases using TFS 2015.  I need to run a large number (i.e., 1,000 or so) of data scripts as part of each deployment.  

数据脚本填充/更新前端所需的配置表,以便将其与数据库中的存储过程相关联。  这不是一个理想的解决方案,但这是我必须要合作的。  

The data scripts populate/update configuration tables required by our front end so link it with the stored procedures in the database.  It's not an ideal solution, but it's what I have to work with.  

在TFS 2005的旧时代,这将是一个短暂的...我只是将它们全部添加到。在lst文件中,它们是构建脚本的一部分,我们将在所有安装中运行它。  

In the old days of TFS 2005, this would be a snap...I'd just add them all to the .lst file, they'd be part of the build script, and we'd run it across all installations.  

不幸的是,TFS 2015虽然让其他事情变得更容易,但似乎更难以实现。  我看过有关使用Powershell脚本运行SQL脚本作为后期构建事件的一部分的文章,但这会有两个问题:

Unfortunately, TFS 2015, while making other things easier, seems to make this much harder.  I've seen articles on running SQL scripts as part of a post-build event using a Powershell script, but this would have two problems:


  1. 那里是一个非常多的脚本,分为文件夹,子文件夹和子子文件夹。  脚本编写将是一场噩梦。  
  2. 由于我正在多台服务器上部署多个数据库,因此Powershell脚本中服务器和数据库的规范将是一个真正的问题。  

在TFS 2015中,真的没有办法让数据脚本成为构建过程的一部分吗?  我错过了另一个更简单的替代方案吗?  

Is there really no way to make data scripts part of the build process in TFS 2015?  Is there another, simpler alternative that I've missed?  

推荐答案

您好Ceemack530,

Hi Ceemack530,

此论坛讨论Microsoft构建引擎又名MSBuild,由于您的问题与TFS构建更相关,我们将移动它的TFS构建论坛以获得支持。

This forum discusses the Microsoft build engine aka MSBuild, Since your issue is more related to TFS build, we'll move it TFS build forum for support.

感谢您的理解与合作。

最好的问候,

Cole Wu


这篇关于需要在部署期间运行大量SQL数据脚本的有效方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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