SunQuest
           MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now!
  #1  
Old August 25th, 2004, 06:50 AM
abhijit_kohli abhijit_kohli is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 32 abhijit_kohli User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 2 m 51 sec
Reputation Power: 5
How to recover a database?

I had MS SQL installed on my comp.I had to reformat my hard drive due to some problems.There was a db in the sql server which i needed.So i saved the .mdf & .sdf files.Then i installed sql server in the formatted hard drive & pasted the .mdf & .ldf files in the Data forlder in MSSQL folder.But the problem is that even after doing this the enterprise manager doesnt show that database.Can anyone help me with this?Is there any way to recover the database?
Thanks a lot

P.S.- I also have whole of the earlier MSSQL folder present in the earlier program files backed up.Would that help in anyway.

Reply With Quote
  #2  
Old August 25th, 2004, 07:08 PM
WillTheGeek WillTheGeek is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 12 WillTheGeek User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hmmmm...

I had to do this recently myself, but this is the sort of thing you do once and forget how you did it because you don't do it that often - if you are lucky. Try this:

I think I had to create a new database with the same name as the old one. Then locate the mdf and sdf files and replace them with the copies you made of your previous database.

HTH

Regards,

WTG

Reply With Quote
  #3  
Old September 1st, 2004, 06:20 AM
ptauwhare ptauwhare is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 19 ptauwhare User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 44 sec
Reputation Power: 0
If you have a backup of the database then the best thing is to recreate the emtpy database and then restore from your backup. sp_attach_db is used to reattach detached databases but may work in this stituation - worth a try. Also - do you have a backup of the master database as this obviously contains all the information on your previous configuration and what databases where on the server etc. Hope this is helpful. Checkout the SQL server books online.

Reply With Quote
  #4  
Old September 3rd, 2004, 04:28 AM
abhijit_kohli abhijit_kohli is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 32 abhijit_kohli User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 2 m 51 sec
Reputation Power: 5
Thanks

Thanks a lot guys.U guys were of great help.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > How to recover a database?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway