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:

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! 😉