Mornin' Folk...
have a strange issue w/ sp_attach_single_file_db. as a preface, i have ran this script many times to move DBs around and have yet to see this particular issue.
Have a DB call Web_Logs. its MDF is physically located in the directory structure 'D:\SQL Server 2000\Data' as Web_Logs_Data.mdf and the LDF "WAS" located in 'D:\SQL Server 2000\Trans_Logs' as Web_Logs_Log.ldf
i ran the following sp first:
exec sp_detach_db 'Web_Logs' ... this went well
i then deleted the 7GB tlog/ldf:
del 'D:\SQL Server 2000\Trans_Logs\Web_Logs_Log.ldf
Once again no problem ....
I then have tried several times the e following command
EXEC sp_attach_single_file_db @dbname = 'Web_Logs',
@physname = 'D:\SQL Server 2000\Data\Web_Logs_Data.mdf'
BUT this is the error i am receiving ...
Server: Msg 1813, Level 16, State 2, Line 1
Could not open new database 'Web_Logs'. CREATE DATABASE is aborted.
Device activation error. The physical file name 'D:\SQL Server 2000\Trans_Logs\\web_logs_log.LDF' may be incorrect.
The problem is that the path for the ldf is wrong. you can see it has 2 '\\' after Trans_Logs where there should only be one. in other words, the path for the LDF should be :
'D:\SQL Server 2000\Trans_Logs\'
NOT ....
'D:\SQL Server 2000\Trans_Logs\\'
Any ideas or mans to look at to try and recover from this error. seems the MDF file has a corrupt path within it that is pointing where the LDF should be created.
As always ... Thanks for the help
have a strange issue w/ sp_attach_single_file_db. as a preface, i have ran this script many times to move DBs around and have yet to see this particular issue.
Have a DB call Web_Logs. its MDF is physically located in the directory structure 'D:\SQL Server 2000\Data' as Web_Logs_Data.mdf and the LDF "WAS" located in 'D:\SQL Server 2000\Trans_Logs' as Web_Logs_Log.ldf
i ran the following sp first:
exec sp_detach_db 'Web_Logs' ... this went well
i then deleted the 7GB tlog/ldf:
del 'D:\SQL Server 2000\Trans_Logs\Web_Logs_Log.ldf
Once again no problem ....
I then have tried several times the e following command
EXEC sp_attach_single_file_db @dbname = 'Web_Logs',
@physname = 'D:\SQL Server 2000\Data\Web_Logs_Data.mdf'
BUT this is the error i am receiving ...
Server: Msg 1813, Level 16, State 2, Line 1
Could not open new database 'Web_Logs'. CREATE DATABASE is aborted.
Device activation error. The physical file name 'D:\SQL Server 2000\Trans_Logs\\web_logs_log.LDF' may be incorrect.
The problem is that the path for the ldf is wrong. you can see it has 2 '\\' after Trans_Logs where there should only be one. in other words, the path for the LDF should be :
'D:\SQL Server 2000\Trans_Logs\'
NOT ....
'D:\SQL Server 2000\Trans_Logs\\'
Any ideas or mans to look at to try and recover from this error. seems the MDF file has a corrupt path within it that is pointing where the LDF should be created.
As always ... Thanks for the help