Restore DB with T-SQL.
p. Just found this useful command “over here”:http://www.kdkeys.net/forums/3162/ShowPost.aspx. You can restore a db backup via the command:
p. RESTORE DATABASE MyDB
FROM DISK = ‘C:\Data\MyDB.bak’
WITH MOVE ’logicalname_data’ TO ‘C:\Data\MyDB.mdf’, MOVE ’logicalname_Log’ TO ‘C:\Data\MyDB.LDF’
p. To find out what the logicalname
is one can execute the following:
p. RESTORE FILELISTONLY
FROM DISK = ‘C:\Data\MyDB.bak’