Sunday, December 11, 2016

Attach .mdf files to create Database in SQL Server

I have got a request to create databases by giving .mdf and .ldf files. Used below steps to create databases.

Attach database method.

Connect to the SQL instance you want to create these databases and right click on database and click on Attach... option.

Click on Add button and give the path where SQL .mdf file is located.

SQL server will automatically attach the related log file and the window will be like below.

Click on to attach the database. You can verify the new database in object explorer once this process is done.

No comments:

Post a Comment