DeploySQL is a small set of Python scripts, to automatically run SQL scripts to update a database.
Also has a script to dump database objects to disk, so that they can be searched or committed to source control.
This provides a low overhead method of keeping your SQL scripts up to date in source control.
- create or update most database objects, such as schemas, tables, stored procedures, views, user defined functions
- write simple CSV files to describe what SQL scripts to apply
- only the necessary SQL scripts are applied to the database, according to the current version of the database
- easily update multiple instances of the same database: for example in dev, in test, and then in production.
- automatically backs up existing database objects, before updating them
- SQL Server 2005 or higher
- SQL Server Management Studio 2005 or 2008
- Python 2.7.x http://www.python.org
- Powershell 2.0 already installed on Windows 7
How to use
In SQL Server Management Studio: (and SQL Server 2005 or later)
1a. create a login dev with password dev123
1b. create a database devTest
1c. add user dev to the database, mapped to the login dev
2. run this script:
3. run these 2 scripts: dbo.spDatabaseVersion_GetVersion.StoredProcedure.sql dbo.spDatabaseVersion_SetVersion.StoredProcedure.sql
4. open a command line ( Start menu -> Run -> cmd )
5. run the copy script, to copy the scripts to a release location:
6. run the deploy script to apply the scripts to the database:
hint: to deploy the SQL more than once, then run this script to clear the output files (including the SQL backup): clear_output_files.bat