How can we help you today? How can we help you today?

SQL Compare 11 can compare all databases schema

Hi All,

Can I choose to compare all databases under a instance instead of choose one by one to do comparison?

Thank you.

Regards,
Justin
justinmac88
0

Comments

3 comments

  • sam.blackburn
    If you want to compare/deploy many databases together, your best bet is probably to call the command line many times in a loop; SQL Compare compares two databases at a time, deploying changes from one to the other.
    sam.blackburn
    0
  • justinmac88
    Hi Sam,

    your best bet is probably to call the command line many times in a loop > Where I can retrieve the comparison script?

    Thank you.
    justinmac88
    0
  • sam.blackburn
    The best implementation depends on your choice of language and what you want to do. For example if you wanted to use Powershell this method might be handy:
    function Get-DBList ($server)
    {
        $srv = New-Object 'Microsoft.SqlServer.Management.Smo.Server' $server
        $srv.Databases | Select name, RecoveryModel, 
            @{Label="CompatibilityLevel";Expression={($_.CompatibilityLevel).ToString().Replace("Version", "")}}
    } #end Get-DBList
    
    From http://dba.stackexchange.com/questions/ ... -databases

    And you could loop through the resulting collection calling SQLCompare.exe with arguments for whatever you wanted to do. The script shouldn't be too hard to write, but it won't produce an interactive experience like the SQL Compare UI.

    I hope this helps.
    sam.blackburn
    0

Add comment

Please sign in to leave a comment.