Microsoft SQL - How to attach database having only mdf file
Views (2457)
Quick trick - I had only mdf file of database without log file. Following t-sql script allowed me to attach mdf file to SQL:
After I run this script I have got several messages but database was restored and worked fine.
sp_attach_single_file_db @dbname= 'NewDatabase', @physname= 'C:\Directory\DataBase.mdf'
After I run this script I have got several messages but database was restored and worked fine.
This was originally posted here.

Like
Report
*This post is locked for comments