I have data file and log file at different location.
data file at location:
while log file at place
Now I want to move this log file to D\folder1\test_log.ldf
How can I achieve this?
I first detach the databse
EXEC sp_detach_db @dbname = N'dump';
Then move the data and logfile to new path
after I run this script
EXEC sp_attach_db @dbname = N'dump',
@filename1 = N'D:\test\dump.mdf', \
@filename2 = N'D:\test\dump_log.ldf';
But its gives me error:
Unable to open the physical file "D:\test\dump.mdf". Operating system error 5: "5(failed to retrieve text for this error. Reason: 15105)".
To get quick answer follow this link:http://www.sqlservercentral.com/articles/Best+Practices/61537/