scripting to master, msdb databases and the target database

djburnsdjburns Posts: 3
edited May 16, 2008 3:56AM in SQL Packager Previous Versions
Is it possible to include a script in the uncompressed resx package1 file that will create a procedure on the master database and then also script the remainder of the procedures and data to the intended new target database? Also i would like to append scripted scheduled jobs that are written to the msdb database. Can I achieve this by simply editing the package1.resx file with each line of the orphaned database statement and laboriously ammend the batch numbers of the data elements and re-total the batch numbers?

If this is possible i.e. using USE [master], USE [msdb] & GO statements to target these orphaned databases, does anyone know of a simple method of renumbering the Batch numbers?



  • Packager can see the master and msdb databases and my solution, however labourious, did work for me.

    Simply edit Package1.resx and insert the statements at the correct points in the script batch files using the 'USE [Master]' statement before targeting the Master database and then once this has compeleted insert the 'USE [whatever_you've_called_your_database]' afterwards to carry on with your original script. Similarly to insert the scripted jobs I targeted the 'USE [msdb]' statement. The only point to make is that the 'GO' statement should never be used as this will break the operation.

    The most painfully mind numbing part was then manually renumbering the Batch numbers in the package file. I seriously lost the will to live during this. If anyone knows a way to renumber the file by a script or any other methods then please let me know.
Sign In or Register to comment.