Guinness Mann (GM***@dublin.com) writes:
I had a hard-drive failure this week and lost my root drive, with
operating system and SQL Server 2000.
Fortunately my data was on another volume and still exists.
I know about sp_attach_db, but looking at BOL, it says that sp_attach_db
only works with databases that were previously detached with
sp_detach_db.
How do I reattach my existing mdf and ldf files?
P.S. I know that the dbs are not corrupt because when the hard drive
failed SQL Server was offline.
I would first try with sp_attach_db. If SQL Server was shut down cleanly,
I would expect the database files to be available.
If that fails, I would try sp_attach_single_file_db.
If that fails, there is an undocumented and unsupported method, that
I am not telling about in a newsgroup, because that methods is just
simply far too dangerous. I have no problem sharing it by mail. But
please try sp_detach_db first.
--
Erland Sommarskog, SQL Server MVP,
so****@algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp