Comments
4 comments
-
Hi Annette,
Off the top of my head, try:
$project = "C:\Work\scripts"
$targetDb = New-DatabaseConnection -ServerInstance "test01\sql2014" -Database "Test"
$options = "ignoreadditional"
Sync-DatabaseSchema -Source $project -Target $targetDb -SQLCompareOptions $options
See example 6 here:
https://documentation.red-gate.com/sca3/reference/powershell-cmdlets/sync-databaseschema
And further docs here:
https://documentation.red-gate.com/sca3/automating-database-changes/automated-deployments/using-sql-compare-options-with-sql-change-automation-powershell-module
-
Hi Alex, many thanks for this, however it's errored with "Invalid compare option specified". Have you got any other ideas please?
-
Not sure why that's not working, one for support I guess.
In the meantime, reverting to the raw SQL Compare command line is my de facto quick fix where possible. -
This should work if you script it this way:
$project = "C:\Work\scripts"
$targetDb = New-DatabaseConnection -ServerInstance "test01\sql2014" -Database "Test"
Sync-DatabaseSchema -Source $project -Target $targetDb -IgnoreAdditional
Add comment
Please sign in to leave a comment.
I have a scenario where I am building a database from source control and that works perfectly, then I need to add some additional tables from a different source controlled database but only from a specific schema but I don't want to drop any of the target objects.
What I need is to use the filter option with the -ignoreadditional but that doesn't work, can you advise please.
Many thanks
Annette