Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Restore from .BAK file
Message
From
03/01/2014 20:57:16
 
General information
Forum:
Microsoft SQL Server
Category:
Backups
Environment versions
SQL Server:
SQL Server 2012
Application:
Web
Miscellaneous
Thread ID:
01591308
Message ID:
01591331
Views:
41
>>I need to "move" a bunch of databases from one computer to another. I have created backup of all databases to an external drive. That is, the external drive now has several .BAK files. Do I need to create the databases on the target computer before I can restore from the .BAK files? Or can I restore and create database from .BAK in one step?
>>
>>TIA
>
>In order to write a script that would restore all databases from a certain folder - without hard-coding each database name - I would need to scan all files with extension *.BAK. How can I create a cursor and scan all files from a folder into the cursor (using T-SQL)?
>Or is there a better way to approach the task?
I frequently have to move DB's, so I wrote some VFP and .NET programs that do that.
Are you committed to TSQL for some special reason?
This is an easy task using VFP with SPT or .NET.
You can write one program to do the backups and the restores.
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform