Reputation: 21
I've upgraded my SQL Server 2005 to 2008, without backing up the databases. I kept the old data folder with the 2 DB.mdf
and DB.ldf
files.
So how can I import or read my .mdf
file into SQL Server 2008 ?
If I try to use the 2008 tools import/export, I am unable to find the source because the 2005 has been replaced. Only the server 2008 is running.
If not possible, An other way, would be to read the .mdf
file with vb if you know
Thank you for your help
regards Mike
Upvotes: 0
Views: 1319
Reputation: 294457
If you attach the SQL 2005 files to an SQL 2008 instance it will know what to do with them (it will upgrade the database). Use sp_attach_db
, CREATE DATABASE ... FOR ATTACH
or even the management tool, How to: Attach a Database.
See Detaching and Attaching Databases.
I recommend make a copy of the files before the attach.
Upvotes: 1
Reputation: 2012
In SSMS right click Database folder --> attach then choose your data file and log file accordingly
Upvotes: 1