SSIS 2012 SQL Agent Job ConnectionString vs Initia

2019-05-07 02:10发布

I was not able to find a resource discussing this from the SQL Agent and SSIS Catalog.

I'm getting behavior that was unexpected when running a package from SQL Agent. I believe that the issue is that I specified a different InitialCatalog property in the sql agent configuration than I used in my connection string environment variable.

Agent Connection Properties

Here you can see my connection string is different.

enter image description here

I was expecting that the ConnectionString would override the InitialCatalog, but it does not seem to be the case.

Which one really overrides the other? Can that behavior be altered? It does not appear that I can omit an InitialCatalog value, but is it actually possible?

1条回答
戒情不戒烟
2楼-- · 2019-05-07 02:49

If you modify a value in the properties windows for a connection manager, it will update the connection string immediately.

The SQL Server Agent has no connection strings (it runs different types of jobs/steps). In this case, it calls DTSExec, which in turn executes the SSIS package.

If you want to override the a property for a connection manager dynamically, then you may want to look at these other questions:

SSIS how to set connection string dynamically from a config file

Quickly changing SSIS-packages data source parameters for easy migration

查看更多
登录 后发表回答