Comparison of actual database schemas against each other (within one database)

Maximilian Ksoll 0 Reputation points
2024-08-17T10:10:18.3266667+00:00

Hi all,

for a small project I created a database within Azure and one schema for dev and one for prod (to save run cost).

I would like to compare these two schemas now with Azure Data Studio, but it looks like, that I can only compare databases with one another.

Anyone faced this issue or can suggest how to do so?

Thanks in advance

Max

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,690 questions
Azure Data Studio
Azure Data Studio
A cross-platform database tool for data professionals using on-premises and cloud data platforms on Windows, macOS, and Linux.
112 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Anas Rez 0 Reputation points
    2024-08-17T10:33:06.7866667+00:00

    Hi,

    It sounds like you're trying to compare schemas within the same database server, but with different schemas for dev and prod environments. Azure Data Studio does have database comparison capabilities, but to compare schemas within the same server, you might need to adjust your approach slightly.

    One effective way to compare schemas in this scenario is to use SQL Server Data Tools (SSDT) or a third-party schema comparison tool. Here's a step-by-step guide using SSDT:

    Install SSDT: If you don’t already have it, you can download SQL Server Data Tools from Microsoft’s website.

    Create a Schema Comparison Project:

    • Open SSDT and create a new SQL Server Database Project.
      • Import your development schema into this project by connecting to your dev database.
        • Create another SQL Server Database Project and import your production schema.
        Perform Schema Comparison:
        - In SSDT, go to the "Schema Compare" feature.
        
           - Set your source schema as the development database project and the target schema as the production database project.
        
              - Run the comparison to view differences and generate a report.
        

    Alternatively, tools like Redgate SQL Compare or ApexSQL Diff can also handle schema comparisons and might offer additional features that suit your needs.

    Using these tools should help you effectively compare schemas from your dev and prod environments.

    Hope this helps!


  2. Oury Ba-MSFT 18,696 Reputation points Microsoft Employee
    2024-09-09T21:46:55.9166667+00:00

    @Maximilian Ksoll Thank you for reaching out.

    You can use schema compare extension to achieve the above.

    https://learn.microsoft.com/en-us/azure-data-studio/extensions/schema-compare-extension

    The Schema Compare extension simplifies the process of comparing databases and gives you full control when synchronizing them - you can selectively filter specific differences and categories of differences before applying any changes. The Schema Compare extension is a reliable tool that saves you time and code.

    Screenshot of the Azure Data Studio G U I, compare schema extension.

    Please don't forget to mark as accept answer if the reply was helpful.

    Regards,

    Oury


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.