Search code examples
sql-serverdatabasesql-server-data-toolsdatabase-project

Compare Data between database project and database


So, I love the schema compare option that comes with SSDT. I'm new to using it, and it's much more efficient than any other way I've used to keep database schemas updated across developer machines.

However, what I really need is to be able to compare DATA. Is there a version of the database project that will let me include table data? That would make setting up new developer machines much easier because we could pre-fill some of the tables with the correct data without having to worry about individual scripts.

Please tell me I missed something and there's a magic button that will let me do this!


Solution

  • I wound up importing the Microsoft.SqlServer.DacFx NuGet package into my C# solution. This essentially let me leverage the tooling behind Visual Studio's Schema Compare to make an in-memory DACPAC and then deploy that to a new database name.

    I've posted a VERY rough usage example on GitHub: https://github.com/dsartain18/DACPAC