SMO: restoring to a different DB
问题 I've read a dozen different blogs, as well as reading through the msdn examples and they just aren't working for me. Ultimately what I'm trying to do is automate moving a DB from our production instance to our dev instance, or the other direction. The approach I've taken is thus: backup/restore to a temp DB detach temp DB copy mdf and ldf files to the other instance reattach. I'm stuck on 1 and I cannot understand why. Everything I've read claims this should be working. NOTE: I've set dbName