Question

I am wondering if it is possible to use the 'initial catalog' property from a connection manager as a variable in SSIS. For example to use the value of the connection string to build a string variable that is evaluated as an expression. So far I haven't found anything so I thought maybe someone here have the answer to 'is it possible or not'.

Thanks, and have a good day.

David

Was it helpful?

Solution

Cart before the horse.

You can create a variable that holds a connection string and then use an Expression to apply that to a ConnectionManager's ConnectionString property.

By default, you won't be able to set the expression on an SSIS Variable based on the value of a Connection Manager's Connection String. It's simply not exposed in the Expression Editor. You can kind of, sort of, get the Connection String by using a Script Task. From there, you can access all the properties of a Connection Manager and interrogate it to determine the connection string.

Unless it has a user name and password in there. The password is sensitive information and I ASSUME, and all that that implies, that you won't be able to pull that bit of data in. If it's an SSPI context then yeah, should be no problem to assign that value back to an SSIS Variable.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top