SQL Compare 8 Command Line switch to EXCLUDE Dependencies
tilleymf
Posts: 3
Hello,
Is there a switch to EXCLUDE Dependencies when using the SQL Compare 8 Command Line to sync two databases?
Thanks - Michael
Is there a switch to EXCLUDE Dependencies when using the SQL Compare 8 Command Line to sync two databases?
Thanks - Michael
Comments
You can just specify /Options:none to exclude dependencies, but you may want to add back in the other default options:
/Options:DecryptPost2KEncryptedObjects,IgnoreFillFactor,IgnoreWhiteSpace,IgnoreFileGroups,IgnoreUserProperties,IgnoreWithElementOrder
Does that help?
Redgate Software
Thanks for the response.
I tried the variations of the /OPTIONS switches you suggested and did not have success. I am including the variations I tried to see if you have any ideas.
Notes:
db1:Ontrack_dev is a Development Source database
db2:Ontrack_Synch is a copy of the database that will be used for testing that will be synched via a batch job calling SQLCompare Command Line.
Dependencies: The UMS database is not present where the Ontrack Dev and Synch databases are located. This is intentional. This is also why we are attempting to run the SQLCompare Command Line WITHOUT dependencies included.
Thanks for your help. (c: - Michael
*************************************************************
First Variation
*************************************************************
E:\RedGate\SQLCompare8>SQLCompare.exe /Options:DecryptPost2KEncryptedObjects,IgnoreFillFactor,IgnoreWhiteSpace,IgnoreFileGroups,IgnoreUserProperties,IgnoreWithElementOrder /db1:Ontrack_dev /db2:Ontrack_Synch /sync
SQL Compare Command Line V8.1.0.360
==============================================================================
Copyright c Red Gate Software Ltd 1999-2009
Serial Number: 002-005-107214-XXXX
Registering databases
Creating mappings
Comparing
Applying Command Line Items
Creating SQL
Synchronizing databases (from DB1 to DB2)
Error: Synchronization of '(local).Ontrack_dev' and '(local).Ontrack_Synch'
failed: Invalid object name 'UMS.dbo.ALL_USERIDS'.
*************************************************************
Second Variation
*************************************************************
E:\RedGate\SQLCompare8>SQLCompare.exe /Options:none /db1:Ontrack_dev /db2:Ontrack_Synch /sync
SQL Compare Command Line V8.1.0.360
==============================================================================
Copyright c Red Gate Software Ltd 1999-2009
Serial Number: 002-005-107214-XXXX
Registering databases
Creating mappings
Comparing
Applying Command Line Items
Creating SQL
Synchronizing databases (from DB1 to DB2)
Error: Synchronization of '(local).Ontrack_dev' and '(local).Ontrack_Synch'
failed: Invalid object name 'UMS.dbo.ALL_USERIDS'.
E:\RedGate\SQLCompare8>
SQL Compare's include / exclude dependencies option refers to dependencies _within_ the same database - when you've selected only some of the objects in a database to be synchronized, but some of your selected objects depend on other objects, SQL Compare will include those objects if you have IncludeDependencies on, and won't if you have removed it.
So on the command line, it's only useful when combined with the /include: and/or /exclude: switches.
It looks like the problem you're having is a SQL Server problem - you can't recreate / alter some objects which reference other objects that are no longer accessible. As far as I know, there isn't an easy way around this - SQL Server checks at the time you create an object if the objects referenced by that object exist, and refuses to create (or alter) the object if they don't.
Sorry for the confusion, and I hope that has at least cleared it up, even though it looks like we can't help with the actual problem...
Redgate Software