Sync-DLMDatabaseSchema Question
MrsFatherjack
Posts: 15 Bronze 3
Hi,
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
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
Tagged:
Answers
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
DevOps Mentor and Coach
Director of DLM Consultants
Creator of Speaking Mentors
Microsoft Data Platform MVP
Friend of Redgate
Twitter / LinkedIn
In the meantime, reverting to the raw SQL Compare command line is my de facto quick fix where possible.
DevOps Mentor and Coach
Director of DLM Consultants
Creator of Speaking Mentors
Microsoft Data Platform MVP
Friend of Redgate
Twitter / LinkedIn
$project = "C:\Work\scripts"
$targetDb = New-DatabaseConnection -ServerInstance "test01\sql2014" -Database "Test"
Sync-DatabaseSchema -Source $project -Target $targetDb -IgnoreAdditional
Product Support Engineer
Redgate Software Ltd
Please see our Help Center for detailed guides on how to use our tools