Skip to content

SQL Server 2025: Local SQL Server Container – Schema compare preview

After my blog about “SQL Server 2025: Local SQL Server Container without Docker Command”, I continue to play & test it.

One new feature in preview is the “schema compare” in this last extension for Visual Code:

I like new feature and now let’s go for a test! 😉

I create 2 identically databases db1 & db2 with 2 tables and some data inside:

I do a select on both tables on both databases to see if everything is the same:

I run the “schema compare” to be sure I have everything is aligned:

Questions about your own setup? A dbi services consultant can look at your case.

Talk to an expert (opens in a new tab)

I select the source “db1”, select the target “db2” and click on compare:

After few seconds (due to my small databases), we have the result:

Good! No schema differences were found! It’s a good start…

Now, I play and change a little bit the db1:

  • On table t1:
    • Add a column c4
    • Drop a column c1
    • Change the data type of the column c2
    • Create a new schema test2
    • Transfer the table t2 from schema dbo to scema test2
    • Create a new table t3

    I run again the schema compare…

    This time, we have a result:

    I have all my change but like other tools it will delete the table dbo.t2 and create a new one test2.t2. This is not really the same as a schema transfer…

    Otherwise, we see the missing table dbo.t2

    I will now run the compare in the other way db2 as source and db1 as target:

    I see now the delete of what I change on db1, then it’s good and fine except the schema transfer like usual…

    I come back to my precedent comparison and this I use the “Switch Direction”:

    I test now the script generation:

    Et voila, I have my change script:

    It will be very nice to use for developers but as you see in my post, you need to be careful with your change (schema change for tables), control and test the script generated before do it on Production databases!

    See you soon for the next test on my Local SQL Server Container! 😉

    Let’s work together

    Ready to operate at
    the next level?

    Tell us about your challenge. We’ll bring the depth, the expertise, and the Swiss precision.

    Stéphane Haby

    Stéphane Haby

    Stéphane Haby has more than 20 years of experience in Microsoft solutions, specializing in the installation, migration, best practices, and performance analysis of Microsoft SQL Server, as well as Microsoft Business Intelligence solutions (SharePoint, Office) and .NET development for the banking sector. A former Microsoft Most Valuable Professional (MVP) and early adopter of Microsoft Team System in France, he has authored several technical articles. He holds Microsoft Certified Solutions Associate (MCSA) and Expert (MCSE) for SQL Server, MCTS, MCITP for SQL Server 2008, and ITIL V3 Foundation certifications. His industry experience covers chemicals and pharma, banking, and financial services.View Author posts

    182 posts since April 2011

    Most read in Docker

    The Docker posts our readers open most: the all-time favourites, and what is trending right now.

    Leave a Comment

    Your email address will not be published. Required fields are marked *