restore a MSQL7 database

due to the millenium bug (that I beleived to be perfectly prepared for
:-((   ) I had to reinstall mssqlserver 7. after this, my main database si not anymore listed in the database list.

howether the .mdf and .ldf files are still there.

is there a way to get my databse back?

and if yes ... which one?

regards, Marc
LVL 4
mhervaisAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mhervaisAuthor Commented:
Adjusted points to 100
0
dtomynCommented:
Look up sp_attach_db in the Books OnLine.  Here is the syntax from BOL"
EXEC sp_attach_db @dbname = 'pubs',
    @filename1 = 'c:\mssql7\data\pubs.mdf',
    @filename2 = 'c:\mssql7\data\pubs_log.ldf'

As to which one of the files to restore... use the syntax above. In case you do not know, the mdf is the "main data file" while the ldf is the log.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mhervaisAuthor Commented:
definately works !!!!!

a lot of thanks and wishes for this new year

regards,

Marc
0
dtomynCommented:
By the way, what exactly happened to cause you to have to reinstall SQL Server?  Or is it a long story?
0
mhervaisAuthor Commented:
short story and you ought to know :
I had an NT4 server that was installed without IIS, but ll updates were normally ok (sp 5). Somebody I work with asked me on to set an FTP server to get some files from me.
I asked a friend who told me to setup IIS from my CD and then to put back SP5
so I did. yesterday
Actually the advice was not good because
FTP needs SP6 to work (I did not know there was an SP6), and when I tried to install IIS again it would freeze during the installation process.
The I new that I would have to put my clock back and to reinstall everything from my cd until I put it on the right date. I wanted to backup my database before to do this (I am not the normal administrator for it and i did not know if it has a backup, but I could not access to it because IIS made a mess in the ODBC drivers)
Finally I had to deinstall mssql7, and to reinstall everything.

the moral of the story is that
1) if we have to reinstall from old cd, we have to go back in the past century before applying the new patches
2) there will probably be a moment when the new patches will not pass on old century dates.
this means that the millenium bug is not behind us but in fronf of us unless the software vendors accept to supply new cd's (that pass the millenium) in exchange for the old ones.

regards, Marc
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.