Executes a file containing T-SQL code without using OSQL. The file can be up to 80,000 characters. Each line in the file should be no more than 256 characters. (Customize the code as needed.) The DOS Type command is used to retrieve the code. Embedded "go"s are removed so don't expect termination behavior. The only parameter is a fully qualified file path passed as a 256 varchar string. Uses dynamic SQL to run the file. Runs in the context of the database your connected to when you call the proc unless the file code redirects it. Holding tables are real tables created in Tempdb and then dropped at the end of execution. This could cause problems in code that repeatedly calls the proc. Use at your on risk.
Build Restore Scripts for All User Databases
Something I really hate is typing something repetitive. To prepare for our Disaster Recovery plan, I wrote this script.It is a bit strange in that it requires 2 run iterations to generate the desired result.I use a naming standard for backup files of the form:D_DBName.Bakand a naming standard for database files of the form:DBName_Dx.Mdf for […]
2003-01-22
577 reads