SQL Server 2000 Detach/Attach question

  • Today I had one of my servers run out of disk space. This caused an issue that my application could no longer update the data base due to the fact that the log file

    could not expand any further. Following a set of instuctions we had on file, I proceded to do the following:

    1. Detach database.

    2. Delete log file.

    3. Attach database so that a new log file would be created.

    When trying to Attach the database without the old log file, I get the following error message:

    Error 1813: Could not open new database 'XXXXXX'. CREATE

    DATABASE is aborted. Device activation error. The

    physical file name 'C:\Program Files\Microsoft SQL

    Server\MSSQL\Data\XXXXXX_log.LDF' may be incorect.

    After clicking OK. I am notified that the Attach failed. Any ideas how to get around this? Any suggestion is greatly appreciated. Thanks!

  • I have faced similar problem once in carrer.

    sp_Attach function can work for some times with out log file .But it would be a best practice to retain Log file with U by renaming it. If the Database is attached without log file it would be fine other wise we can use the renamed log file to attache the DB.

    madhusudannaidugundapaneni


    Madhu

  • Check out the stored procedure sp_attach_single_file_db in the Books OnLine. I believe that command is what you need. This command will cause a new log to be created.

    -SQLBill

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply