An SSIS package that I'm building has two OLE DB connections, to databases named "core" and "staging". I created test versions of these two databases on my local SQL Server installation. I named them "test1_core" and "test1_staging". The "test1_" namespace is necessary because I have many SSIS different packages in active development at one time, and many of them refer to the same production databases. But it need each local SSIS package to refer to its own version of the database.
This works okay until I need to refer to the database name in the package specifically like in an Execute SQL task that includes two connections.
Also, I have SQL scripts that say use [core]
at the top and I wish I could just use them on my local server without always having to open them up and change that line to use [test1_core]
first, then having to change it back.
Is there some way to namespace the database name from within SQL Server so I can just refer to the local database as "core" from the SSIS package?
use
statement in your Execute SQL Tasks?