Came across a great script from Ken Kaufman on copying backups using xp_cmdshell. Thought I'd contribute a script I wrote that builds on that to restore the latest production backup to a testing or development server.
In this case I routinely create all my production backups to a network share and then use that source to restore the database in on my beta server. this way I ensure all the data as well as the schema are exact mirrors. Last step I do is to update permissions between the two copies.
If anyone has any comments or suggestions please let me know. Scripting it this way proved to be a blessing since it was just about impossible to keep the changes to schema objects in sync on my development server, and manually determining which backup to restore was always a manual process.
Is there a way I can automate a file deletion process from within SQL Server?