• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 325
  • Last Modified:

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
  • 3
  • 2
1 Solution
mhervaisAuthor Commented:
Adjusted points to 100
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.
mhervaisAuthor Commented:
definately works !!!!!

a lot of thanks and wishes for this new year


By the way, what exactly happened to cause you to have to reinstall SQL Server?  Or is it a long story?
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now