Friday, February 24, 2012

Help restore a database!

Hi SQL gurus!
My PC crashed but was able to recover some of my data including the
directory and folder with SQL Server 2000. I bought a new PC and want
to restore some of my databases. I tried to create a new database with
the same name and then copy and paste data and log files to a Data
folder but the system wouldn't allow me to do that. Is there any other
way to use my data and log files to restore datbases on the new PC?

Many thanks!

Stan

suslishe@.mail.ruTry using sp_attach_db to attach the database files. For example:

EXEC sp_attach_db
'MyDatabase',
'C:\DataFiles\MyDatabase.mdf',
'C:\LogFiles\MyDatabase_Log.ldf'

Note that this may not work since your databases were not cleanly detached
using sp_detach_db. You may get lucky, though.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Suslishe" <suslishe@.netscape.net> wrote in message
news:d404c196.0312121220.20ef44be@.posting.google.c om...
> Hi SQL gurus!
> My PC crashed but was able to recover some of my data including the
> directory and folder with SQL Server 2000. I bought a new PC and want
> to restore some of my databases. I tried to create a new database with
> the same name and then copy and paste data and log files to a Data
> folder but the system wouldn't allow me to do that. Is there any other
> way to use my data and log files to restore datbases on the new PC?
> Many thanks!
> Stan
> suslishe@.mail.ru

No comments:

Post a Comment