I have test database and a production database. When developing I of course work against that test database then when deploying I have to semi-manually update the production database (by running a batch-sql-script). This usually works fine but there’s a chance for mistakes where the deployed database isn’t the same as the test database.
For tables: Is there any way that I can automatically test all entities that I’ve mapped using linq2sql against a the production database so that all properties etc. exist?
I use a similar approach during development and I can ensure that the synchronization between the development and production databases can easily become a daunting task if you modify too many tables at once.
I realized that the best approach would be to forget about doing this synchronization manually, it’s simply too time consuming and prone to errors, and started using a tool to automate the process.
I’ve been using the RedGate SQlCompare and I can say that I couldn’t live without it anymore. It compares all the structure of the databases, pointing the modifications and applying the changes flawlessly, even in tables with millions of records.
Link to Redgate SQL Compare