Wednesday, March 4, 2009

How to setup Database from MDF file

Dear Reader,

I was writing a user manual for a client, A part of it is about setting up a database in SQL Server 2008 from .MDF file. Thought let me blog this simultaneously so that it could be useful for surfer who look for a way to setup a database in SQL Server.Necessary measures are taken to protect sensitive information :)

Following are the steps to be done to setup database in SQL Server 2008.

Step #1: Right click on Database, Select Attach…

Step #2: A window with title Attach Databases will be shown to add the database files. Click on Add button.

Step #3: A window with title Local Database files – Computer Name, will be displayed. Browse and select the respective .mdf file for which you need to add the Database.

(Click to view full screen)

Step #4: The select database file with the .mdf life & the .ldf file will be loaded. Please refer Screen #48. There are two options either we can click OK to finish adding the Database or If you want to reset log file .ldf file, select and remove the second file as shown in screen #48 and click OK to add file Database with log file. When this activity is done the SQL Server automatically creates a .ldf file.

(Click to view full screen)

Hope it helps...

Cheers :)


No comments: