I want to restore my local dev database from a database that sits on a different server.
restore localdb from foreigndb....
开发者_JAVA百科
I assume that when you said you want to restore database, you already have backup file (.BAK) for that database.
It can be done couple of differnt ways,
1) You can restore database from .BAK file stored on network drive, but it can take really long time and it is not reliable. And also account under which SQL Server service is running has enough permissions to do the operation.
2) As E.J. suggested, You can copy that .BAK file from network drive to your local machine and do restore that will be more reliable and faster operation.
3) Alternatively you can create SSIS package to automate this whole process.
I always just backup my production database to a ".bak" file, copy the file to my dev server, and restore from that file using management studio (or enterprise manager in your case). Has the benefit of letting you repeatedly do a restore from a fixed point which can be helpful during development/testing.
精彩评论