Re: Rebuild .LDF File

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Gregory A. Larsen (greg.larsen_at_netzero.com)
Date: 09/28/04


Date: Tue, 28 Sep 2004 07:15:14 -0700

Sounds like you have tried "sp_attach_single_file_db" (although this isn't
what you typed). This command to use to attach a database that only has a
the data file. I would review BOL and try this command again. Also is it
possible that you data file is corrupted?

-- 
----------------------------------------------------------------------------
----------------------------------------------------------------------------
-
Need SQL Server Examples check out my website
http://www.geocities.com/sqlserverexamples
"Steve" <anonymous@discussions.microsoft.com> wrote in message
news:382a01c4a55e$ce066150$a301280a@phx.gbl...
> I'm running SQL Server 2000, trying to rebuild a
> transaction log since I only have an .MDF file. I've tried
> creating a new database with the same name, stopping SQL
> Server, then inserting the real data file, and setting the
> database to emergency mode, then running the DBBC
> Rebuild_Log('dbname', 'c:\somepath') and that command
> appears to execute ok in Query Analyzer, but the log file
> is not created. Is there any other method for attaching
> the .mdf when you don't have the valid .ldf that goes with
> it. (I've tried sp_attach_single_file) and that doesn't
> work either. I get an error message that says it can't
> find the log file (this db was pulled off of another
> system that had the log file path stored pointed to
> another drive). Any help is appreciated.
>
> Thanks


Relevant Pages

  • Re: How delete a log file
    ... Insted of detaching the database you can empty the second LDF and Remove the ... use the EMPTY FILE parameter in DBCC SHRINKFILE command. ... Can you try detaching the database, delete the log file and then ...
    (microsoft.public.sqlserver.server)
  • Re: Transaction Log increasing
    ... It's not uncommon for your transaction log to grow ... setting the database to use the SIMPLE recovery model is ... > The database currently has one data file and one log file. ...
    (microsoft.public.sqlserver)
  • Transaction Log increasing
    ... The database currently has one data file and one log file. ... timestamp of 2 weeks ago. ...
    (microsoft.public.sqlserver)
  • Re: sp_attach_single_file_db
    ... >I only have a MDF file not the log file and I used the following command ... CREATE DATABASE is aborted. ... > Device activation error. ...
    (microsoft.public.sqlserver.clients)
  • Log files - Location
    ... I know how to detach the database, move location of database files, and attach database pointing to new location. ... I can't get it to work if the log file is on a drive different than the data file. ...
    (microsoft.public.sqlserver.server)