Monday, March 12, 2012

Recover Database from MDF/LDF Files

Hi,
I have only a pair of mdf/ldf files for a database, and want to recover to a new instance of SQL Server 2000. Please advise the procedure to perform this. Thanks a lot,
Jake
Jake,
you need to reattach the database. The syntax for this is as follows:
EXEC sp_attach_db @.dbname = 'pubs',
@.filename1 = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs.mdf',
@.filename2 = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs_log.ldf'
HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Paul, I need to do the same thing but I'm using SQL Server Management Studio
from the June CTP of SQL Server 2005. My MDF and LDF files were created in
SQL Server 2000 MSDE. Can you tell me how execute the reattachment from the
Management Studio interface?
I'd be very grateful for any help. Thanks.
Peter
"Paul Ibison" wrote:

> Jake,
> you need to reattach the database. The syntax for this is as follows:
> EXEC sp_attach_db @.dbname = 'pubs',
> @.filename1 = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs.mdf',
> @.filename2 = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs_log.ldf'
> HTH,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p
|||Peter,
sorry but my VMWare has timed out, so I don't currently have access to the
CTP. Probably best to post up in the beta newsgroups.
Cheers,
Paul Ibison
|||Thanks anyway Paul
Peter
"Paul Ibison" wrote:

> Peter,
> sorry but my VMWare has timed out, so I don't currently have access to the
> CTP. Probably best to post up in the beta newsgroups.
> Cheers,
> Paul Ibison
>
>

No comments:

Post a Comment