N/APosted on - 05/25/2011
I am a student. I am naive in the computer world as well as software section. Now a days I am studying Microsoft SQL server. I am using Microsoft SQL server 2005 edition. I have a database mdf file and log file. I need to attach those files again in the database. As my SQL server is new, this database is not there. But I don’t know exactly how to attach a database.
Can anyone tell me?
Help me please.
Attaching database SQL 2005 question
Attaching a database is not so hard. You need to paste your desired mdf and log file in C drive's MS SQL folder. In MS SQL folder, there is a folder named data. Just paste these two files there. Now start the MS SQL server. Connect it. In object Explorer you can find a list of named databases. In default settings this window is to your left hand side.
You can select attach by right clicking on databases, see in image 1. Now there is a new window open. In this window add mdf file location by clicking on add see image 2. You can browse the place where you placed the mdf file that is to the data folder in MS SQL folder. See image 3. After selecting your desired file, click ok. Now your mdf and log file is in a new window, as in image 4. Now just press OK and your attaching is complete.
Now connect your database to your desired project. I hope I made everything clear about your query.