I have some sql server's backup file(format .bck). In my case, I do not know log file name.
So I can't use with move
in restore command.
Is there anyway to restore database without move? If yes, please guide me.
I want to use like below one.
restore database testdb from disk = 'folderpath\aatest.bak'
asked May 21, 2013 at 11:48
user2053420user2053420
1 Answer 1
You sure can know the log file name and use WITH MOVE
. Use RESTORE FILELISTONLY
to retrieve the list of database files (including log) from the backup first.
answered May 21, 2013 at 11:51
Sign up to request clarification or add additional context in comments.
4 Comments
Remus Rusanu
rename to change extension is a
MOVE
I have tried like following, but noting will happened always throws
is not part of database
error. 1)RESTORE DATABASE test from disk='test.bak' WITH MOVE 'ADF' TO 'F:\test.adf', move 'ALF' To 'F:\test.alf';
2)RESTORE DATABASE test from disk='test.bak' WITH MOVE 'test.ADF' TO 'F:\test.adf', move 'test.ALF' To 'F:\test.alf';
lang-sql