Sometimes we receive .mdf file only no log file.
If we use Attach command it gives error (something like "no log file found ")
We can attach a SQL Server database (.mdf file) with a missing log (.ldf) file.
Procedure:
Open SQL Studio
Right click on any datatbase and click "New Query"
Run the following System Stored Procedure
sp_attach_single_file_db @dbname= 'NewDatabaseName', @physname= 'C:\Users\AIqbal\Documents\Project1\northwind.mdf'
this will create new database and new log file under same folder
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment