I have my development database, I want to spin off a duplicate for testing. I want to do this often.
What's the fastest and easiest way to do this often? I can get the job done by generating scripts w/ data included but I feel like there must be a better way. Should I back up database 1 then screw around with it so I can restore it as a different name?
Detach the database, copy the .MDF file (and .ldf file) and you can attach both. Or only one, to keep one as a copy for a fast copy later.
The "Copy database" command from Mcirosoft SQL Server Management Studio can also work like this.
You can automate/script this easily, using PowerShell or just .Cmd files with calls to osql.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With