Comments
4 comments
-
SQL Compare deployment scripts are created dynamically: you specify a source and a target.
You need to pre-create the target database and the name of the target database is largely irrelevant once you compare and deploy (assuming you don't have for example Stored Procedures which use three-part name references) -
Hi Sergio: sadly, my question is indeed describing a situation where I have stored procedures using three-part name references.
-
In that case not, SQL Compare can't replace references inside Stored Procedures.
A workaround that can be used is to use synonyms: this means that you can use an unchanged Stored Procedure regardless of the database, you can then pre-create the synonyms differently on each database and use a SQL Compare Filter to exclude synonyms from the comparison.
-
Thanks for the information!
Add comment
Please sign in to leave a comment.
USING
(
SELECT Fields
FROM
StagingDatabase.StagingTable
INNER JOIN
OtherStagingDatabase.StagingTable ON
Condition
) AS Source
USING
(
SELECT Fields
FROM
StagingDatabase_DEV.StagingTable
INNER JOIN
OtherStagingDatabase_DEV.StagingTable ON
Condition
) AS Source
OK so far as it goes, but the same code on the QA server couldn't keep the _DEV references, so it would need to look like this:
USING
(
SELECT Fields
FROM
StagingDatabase_QA.StagingTable
INNER JOIN
OtherStagingDatabase_QA.StagingTable ON
Condition
) AS Source
So, when I use SQL Compare to generate a deployment script, I'd need to