How to Attach MDF file Without LDF File by using SSMS

Attach MDF file Without LDF File by using SSMS:

  • There are two ways to attach an MDF file without an LDF file.
    • By using SQL Server Management Studio.
    • By using T-SQL Query.

STEP-01:

  • Attach MDF file w/o LDF file by using SQL Server Management Studio.
  • Open Microsoft SQL Server.
sql ldf screen

STEP-02:

  • In Object Explorer, connect to an instance of the SQL Server Database Engine and then expand that instance.
  • Right-click on DATABASE and select the option “Attach”
sql ldf attach

STEP-03:

  • Attach Window will open.
  • Press “ADD” button.
sql ldf Add

STEP-04:

  • Choose the path & select the MDF file.
sql ldf select

STEP-05:

  • After the above step, the system will add MDF and LDF file.
  • Select LDF file and Press “Remove” button.
  • Press “Ok” and the system will attach MDF file with new LDF file.
sql ldf select 1
How to Create New Database in Microsoft SQL Server
Database Files and Filegroups– Microsoft Docs

Leave a Reply