I'm looking for a tool or an open-source project that can generate database update scripts in the following way:
- Accept a database connection string as a config parameter
- Connect to the specified DB and get a list of all DB objects: tables, stored procedures, constraints, etc. (ideally I'd like to customize the kinds of objects to look for - i.e. only tables or only stored procedures)
- Generate a SQL script containing code that checks whether each of the discovered objects exists, and creates one if it doesn't exist.
I currently need to do this for a SQL Server database.
The purpose of this tool would be to periodically synchronize database structure between multiple instances.
Windows is preferable. The cheaper the better (obviously), ideally I would like to find an open-source project that does something similar. But I don't have any fixed price limit.