I have a Sql Server 2005 Standard production database with some <120 tables and <150 stored procedures.
The newer version update requires beside the application layer upgrade also the upgrade to the db. According to the resources provided I intent to perform the upgrade as follows:
- create for each new table create script with insert data ( if any) . Please the script in separate file named: n.Create_Table_Name.sql
- create for each new stored procedure create script with permissions. Please script for each proc in n.Create_StoredProcName.sql
- create for each alter proc new file named n.Alter_StoredProcName.sql
- Run each script one by one to the TEST db. If test failed ( something has to be changed , etc. , restore back full_backup on top of test db and start all over.
I have a DDL trigger which stores every DDL event in a table – e.g. I could easily track what everything has changed from a particular time point .
Ary there any scripting tools other than SSMS I could simply pass the names of the objects which will generate all the ddl statements for me + the permissions I COULD RELY ON ?
The whole process is kind of slow, but has worked several times, yet I wander if there are any improvements to be made ( No other software than SSMS could be install on our PROD servers )
Here is the cmd for running the sql files
Ended up using ScriptDb.exe or you could use SSMS . On windows 7 and sql server 2008 did not build correctly at the beginning. Had to find the appropriate dll’s to build it first …
ScriptDb.exe -con:server=(local);trusted_connection=yes -outDir:. -ScriptAllDatabases -Permissions -Purge
and than copying just the files of the needed objects:
SELECT distinct