Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Comparing schema by schema name in Visual Studio and SQL Server

I have a SQL Server database with the default schema and a custom schema. So for example two tables might be database.dbo.table1 and database.customschema.table2.

I want to keep the "customschema" under source control, and I have loaded that into my Visual Studio SQL Server Database Project.

When I use the Tools -> SQL Server -> New Schema Comparison... utility, it returns differences for all database schemas.

It would show all the "dbo" tables as being different/deleted in the database project even though I don't intend to keep them in the project under source control.

Is there a way to limit the results to show differences between my database project and the actual database for the "customschema" objects?

like image 636
Eric Avatar asked Feb 14 '26 11:02

Eric


1 Answers

There is a way to achieve this. Perform schema comparision once, on the result page exclude all the unnecessary schemas and leave the ones that you want to compare. Later on save this comparison file (probably add to .gitignore also) and than you can use this file to perform comparisons only for the specific schema cause the file will contain filter settings.

like image 51
Sebastian Studniczek Avatar answered Feb 17 '26 02:02

Sebastian Studniczek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!