SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Have 2008 DB files, but not the backup file
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

token
Posting Yak Master

United Kingdom
133 Posts

Posted - 09/21/2012 :  14:47:40  Show Profile  Reply with Quote
Hi all!

I have found my old 2008 database file (.mdf) and log file and I want this database to appear in my new installation of SQL Server 2012. Unfortunately I don't have a .bak file for the database - I only have the actual DB files themselves.

What I have tried to do so far is create a new database with the same name as my old one but in SQL 2012 and then deleted the new DB files and replaced them with my old database files. However SQL 2012 is not happy with this and when I go to look at the database in Management Studio it says "recovery pending" and the database is inaccessible.

Any suggestions on what I can do please?

sunitabeck
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 09/21/2012 :  14:58:31  Show Profile  Reply with Quote
You can try to attach the database - follow the steps described here: http://msdn.microsoft.com/en-us/library/ms190209.aspx
Go to Top of Page

token
Posting Yak Master

United Kingdom
133 Posts

Posted - 09/21/2012 :  16:55:30  Show Profile  Reply with Quote
thank you so much it worked :)
Go to Top of Page

sunitabeck
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 09/22/2012 :  12:47:29  Show Profile  Reply with Quote
Great, I am glad it worked!! Attaching a database may not always work correctly, if what I hear on the grapevine can be believed. In the future, if you want to move the database, rather than detaching and attaching, use backup/restore.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000