• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 310
  • Last Modified:

problem attaching to mdf when ldf missing SQL Server 2000

Have a customer with a bad ldf. Tried to run the following to recreate the ldf but it displays the following error. Any ideas?

USE [master]
GO
-- Method 1: I use this method
EXEC sp_attach_single_file_db @dbname='Production',
@physname=N'C:\Program Files\program\Databases\Production.mdf'
GO

Server: Msg 1813, Level 16, State 2, Line 1
Could not open new database 'Production'. CREATE DATABASE is aborted.
Device activation error. The physical file name 'C:\Program Files\program\Databases\Production.ldf' may be incorrect.



0
glenn_r
Asked:
glenn_r
  • 2
  • 2
1 Solution
 
Anthony PerkinsCommented:
Unfortunately, the log file is an intrinsic part of the the database, if you do not have a backup then your best bet may be this:
Recovering from a deleted log file on SQL Server
http://www.spaceprogram.com/knowledge/sqlserver_recover_from_deleted_log.html

But I will be impressed if you can solve this without a backup and without major data loss.
0
 
glenn_rAuthor Commented:
The instructions to add the faux DB and export its contents worked like a charm. Recovered all the data without the LDF. Thanks
0
 
glenn_rAuthor Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for glenn_r's comment http:/Q_27513683.html#37355060

for the following reason:

great
0
 
Anthony PerkinsCommented:
>>The instructions to add the faux DB and export its contents worked like a charm.<<
The author either needs to indicate what instructions they are referring to or award points appropriately.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now