DatabaseComparer is a C# console application that compares data between two SQL Server databases with the same schema. It highlights added, deleted, and modified rows in a detailed HTML report.
- Compares selected tables between two databases.
- Detects:
- 🔄 Modified rows (highlighted in yellow)
- ➕ Added rows in DB B (highlighted in green)
- ➖ Deleted rows from DB A (highlighted in red)
- Outputs a clean, color-coded
report.html.
Edit appsettings.json:
{
"DatabaseA": {
"ConnectionString": "Server=localhost;Database=MyDbA;Trusted_Connection=True;"
},
"DatabaseB": {
"ConnectionString": "Server=localhost;Database=MyDbB;Trusted_Connection=True;"
},
"TablesToCompare": [
"Customers",
"Orders",
"Products"
]
}dotnet build
dotnet runAfter execution, open report.html in your browser to view the comparison results.
This project is licensed under the MIT License.
Feel free to fork this repository and submit pull requests for improvements such as:
- UI enhancements in HTML output
- Support for custom primary keys
- Command-line arguments
- Different database engines
Questions? Ideas? Reach out via GitHub Issues.