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)
 Attach .Bak file to SQL Server 2005

Author  Topic 

dnf999
Constraint Violating Yak Guru

253 Posts

Posted - 2007-11-28 : 11:30:53
Hi

I am very inexperienced with the Administration side of SQL Server 2005.

I have been given a .bak file which I need to restore onto my SQL Server. The database .bak file was created on another PC and I cannot seem to restore/recover the .bak file onto my SQL Server.

Can anybody help me with this?

Thanks!!

anonymous1
Posting Yak Master

185 Posts

Posted - 2007-11-28 : 11:32:54
how are you trying to restore? what is the problem/error you have?
Go to Top of Page

dnf999
Constraint Violating Yak Guru

253 Posts

Posted - 2007-11-28 : 11:37:48
That's the problem, I don't know how to attach the retrieve the .bak file to my server as a database...
Go to Top of Page

Van
Constraint Violating Yak Guru

462 Posts

Posted - 2007-11-28 : 11:53:55
Have a look at the RESTORE command.
Go to Top of Page

Zoroaster
Aged Yak Warrior

702 Posts

Posted - 2007-11-28 : 14:21:53
quote:
Originally posted by dnf999

That's the problem, I don't know how to attach the retrieve the .bak file to my server as a database...




You can use:
RESTORE DATABASE <databasename> FROM DISK 'the path and filename of the bak file here'

This will work unless the database already exists in which case you can replace it or move it using syntax for RESTORE from books online. You can get more info on what is contained in the backup file using RESTORE FILELISTONLY





Future guru in the making.
Go to Top of Page
   

- Advertisement -