Attaching database SQL 2005 question

Asked By 1200 points N/A Posted on -
qa-featured

Hello,

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.

SHARE
Best Answer by jakie
Best Answer
Best Answer
Answered By 450 points N/A #101799

Attaching database SQL 2005 question

qa-featured

Hi,

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.

Related Questions