T-SQL deployment scripts are tedious to write and they get no love. As a result, they are very often the most horrible, error-prone step-children of scripts*. One basic principle that could help is to develop a habit of using the “IF NOT EXISTS” or “CREATE OR ALTER” patterns in these scripts. The idea is to first check the existing database before creating new objects. This is far better, in my opinion, than the common “DROP and CREATE” pattern, which can lose data and/or permissions if misapplied. Whenever possible, this type of deployment code should use the SQL Server Catalog Views, and not the deprecated ones. INFORMATION_SCHEMA has been demonstrated to be flakey by others.