Wednesday, 13 July 2011

Attach Database with MDF file only

Use master
go
create database test on
(name=logicalfilename,
 filename='physical path of mdf file ')
for attach_rebuild_log
go

Above commend create one log file for this test DB and location for physical file as same as mdf file .
this commend is very useful if you lost the ldf file of any user database.

No comments:

Post a Comment