Click to See Complete Forum and Search --> : How to recover sql server database data


method
06-20-2007, 07:32 PM
Hi all. A few days ago i installed mcafee total protection 2007 and that disabled my internet connection totally!! I couldn't fix it so i had to uninstall it. After uninstalling mcafee total protection 2007 still i couldn't join Internet!!

So i got mad and went and made repair installation of windows xp pro. After repair installation i couldn't activate it since Internet connection was still not working!! So i went and installed another copy of xp pro on different folder and named it WINDOWS (old one was WINDOWS2).Thanks god now i could join Internet but all my shortcuts and menu items are not visible.

Unfortunately I can't even start sql server 2000 either!! could any one tell me what should i do in order to get access to all database tables and data that i had in sql server and make a back up. I didn't install any new sql server yet. I be happy if an expert tell me what should i do. The installation folder of old windows(WINDOWS2) is still available along with sql server installation folder.Thank and looking forward for reply.

russell
06-22-2007, 10:12 AM
ok, first, do have backups of the databases? probably not or u wouldn't be asking right...?

ok go find and copy all of your .mdf and .ldf files to a new directory. by default they are located at c:\Program Files\Microsoft SQL Server\MSSQL\Data\

when you reinstalled windows, you overwrote your registry -- which is not a good thing -- as windows now doesnt know where to find anything you had installed, so it is probable that you will now have to reinstall MSSQL.

once that is done, can try using sp_attach_db for all of your user databases


EXEC sp_attach_db @dbname = N'pubs',
@filename1 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs.mdf',
@filename2 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs_log.ldf'