attach error | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

attach error

I am getting this error: Server: Msg 1813, Level 16, State 2, Line 1
Could not open new database ‘cryrep’. CREATE DATABASE is aborted.
Device activation error. The physical file name ‘D:DCSWAREMSSQLcryrep_log.LDF’ may be incorrect. when running this script: sp_attach_single_file_db @dbname = ‘cryrep’, @physname = ‘D:DCSWAREMSSQLcryrep_Data.MDF’ do you have any thought why? Thanks, Ben
Silly question: is log file there?
If yes, try using EM. The idea is: if log has some problem, you can create a new one.
Luis Martin
Moderator
SQL-Server-Performance.com All postings are provided “AS IS” with no warranties for accuracy.
the log is not there. When I say ok to creat a new log is when I get the error. The database was never detached, the instance of SQL was removed, and this is why I have to attach it to another instance. Would this cause a problem? Thanks, Ben
But you still have error using EM?.
Luis Martin
Moderator
SQL-Server-Performance.com All postings are provided “AS IS” with no warranties for accuracy.
yes, even with EM. I’m starting to get worried as it has to be going again tomorrow. Any ideas you have are appreciated. Thanks,
Ben
Just to try, use again EM, attach, find MDF, erase tild in log file, change database name in attach as, raigh now I can’t image other solution. Luis Martin
Moderator
SQL-Server-Performance.com All postings are provided “AS IS” with no warranties for accuracy.
Another suggestion is to create a brand new database with the same name/path/details. Detach the database and then copy and use that LDF and the original MDF. I dont know how ‘valid’ a logfile must be to reattach.
Refer to this kBAhttp://support.microsoft.com/default.aspx?scid=kb;en-us;271223 for information and workaround. Do you have complete backup for this database, if so simply restore the database to create the database. Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
]]>