1

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

1 Answer 1

3

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

One of my files has data,log file's name are same, only file extension are different. for example data file = 'C:\user\test\db.ADF' log file = 'C:\user\test\db.ALF'
So I can't use move, that why I said do not want with move part.
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';

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.