Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 backing up from .bak file

Author  Topic 

sujithukvl@gmail.com
Starting Member

22 Posts

Posted - 2007-06-25 : 02:31:34
I got a .bak file from my friend
I want to restore the data base (presently I don’t have any database in my system).

But while I try to restore it
I am getting an error



System.Data.SqlClient.SqlError: Directory lookup for the file "D:\Microsoft SQL Server 2005\mydatabase.mdf" failed with the operating system error 2(The system cannot find the file specified.). (Microsoft.SqlServer.Smo)



I have installed Microsoft sql server in a different directory
Not where he is installed

I can successfully restore the back up files of data base on my own system
But not the backup files created from others systems

nr
SQLTeam MVY

12543 Posts

Posted - 2007-06-25 : 08:02:26
Have a look at the with move clause in the restore command.
You can restore the headers to find the logical file names.

If you are doing it from the gui then overwrite the paths in the file tabs.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-06-25 : 08:21:59
See also: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=RESTORE%20syntax%20/%20example
Go to Top of Page
   

- Advertisement -