如何使 SSIS 包中的服务器名称动态化 [英] How to make the server name dynamic in an SSIS package

查看:26
本文介绍了如何使 SSIS 包中的服务器名称动态化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有很多 SSIS 包,它们都连接到同一个数据库.我不想将服务器名称硬编码到每个数据库中的 db 连接中,因为它与 dev 到 live 服务器不同.这些服务器名称可能会随着时间的推移而改变.

I have many SSIS packages that all connect to the same database. I don't want to hard code the server name into the db connection in each database, because it is different from the dev to live server. And those server names might change over time.

我知道您可以将它放在配置文件中,但所有这些 SSIS 包都存储在 SQL Server 2008 中,我想将所有详细信息保留在 SQL Server 中.

I know that you can put it in a config file, but all these SSIS packages are stored in SQL Server 2008 and I want to keep all the details in SQL Server.

有没有人有任何建议或建议?

Does anyone have any suggestions or advice?

我正在考虑创建一个名为 GetServerName 的包,它返回服务器名称,我可以用它来更改每个包中的连接.但可能有更好的方法.

I was thinking about creating a package called GetServerName that returns the server name, which I could use to change the connections in each package. But there might be a better way.

推荐答案

SSIS 中一个非常好的功能可以解决您的问题,称为包配置.许多人对如何存储动态服务器/包属性/变量值-配置文件、环境变量、sql server 或注册表项有不同的意见和/或想法.我个人喜欢将所有信息存储在 SQL Server 中,这正是您想要做的.为此,请按照本文中的步骤操作:包配置步骤

A very nice feature in SSIS to solve just your sort of problem is called package configurations. Many people have different opinions and/or ideas on how to go about storing you dynamic server/package properties/variable values-configuration files, environment variables, sql server, or registry entries. I personally like storing all the information in SQL Server, which is what you are wanting to do. To achieve this, follow the steps in this article: Package Configuration Steps

这篇关于如何使 SSIS 包中的服务器名称动态化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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