Expected Synonym Behavior
Shaggy
Posts: 16 Bronze 1
SQL Change Automation doesn't appear to detect differences in the base_object_name of a synonym. Consider the following:
1. The synonym is deployed from source control if it doesn't exist in the target DB. << as intended
2. The synonym is dropped from the target DB if it doesn't exist in source control. << as intended
3. No action is taken to deploy a new version of the synonym if the base object referenced by the synonym is different between source control & the target DB.
Does anyone know if this behavior is by-design?
1. The synonym is deployed from source control if it doesn't exist in the target DB. << as intended
2. The synonym is dropped from the target DB if it doesn't exist in source control. << as intended
3. No action is taken to deploy a new version of the synonym if the base object referenced by the synonym is different between source control & the target DB.
Does anyone know if this behavior is by-design?
Tagged:
Best Answers
-
Sergio R Posts: 610 Rose Gold 5No, this is not expected.
Maybe you are excluding synonyms in step 3 using a filter?Sergio
Product Support Engineer
Redgate Software Ltd
Please see our Help Center for detailed guides on how to use our tools -
Sergio R Posts: 610 Rose Gold 5<IgnoreDatabaseAndServerName>True</IgnoreDatabaseAndServerName> means that if the synonym exists in both source and target and the only difference is database and server name, then it will be considered identical and no differences will be deployed
In your case since you set it to False it considers synonyms to be different, if either the database or server name are different and will deploy these differences
I wouldn't say it's unsafe to set this option, as long as you are aware of its consequences
Sergio
Product Support Engineer
Redgate Software Ltd
Please see our Help Center for detailed guides on how to use our tools
Answers
The synonym section of my filter.scpf is:
My ComparisonOptions.xml file contains this entry:
<IgnoreSynonymDependencies>False</IgnoreSynonymDependencies>
<IgnoreDatabaseAndServerName>False</IgnoreDatabaseAndServerName>
Can you confirm if this is valid/safe?