• Nils Gustav Stråbø (9/24/2010)


    Jonathan Kehayias (5/27/2009)


    When you attach without the log file, it is rebuilt, which can leave your database incosistent, not a good thing to do.

    I don't even think you can attach a database without a transaction log if the database wasn't shut down in a clean manner, and by that I mean that there would be no need for rollback or roll forwards during startup.

    So if you delete the transaction log file and the database was not shut down properly there is no chance in h*** you can attach the database again.

    Or am I missing something? Not that I would ever do something like that.

    You can get it back into the server but as I said above, it won't be guaranteed to be consistent. You may have to hack around it to get it back in, but it can certainly be done. I wouldn't advocate deleting a log file ever, but people do it for some reason.

    Jonathan Kehayias | Principal Consultant | MCM: SQL Server 2008
    My Blog | Twitter | MVP Profile
    Training | Consulting | Become a SQLskills Insider
    Troubleshooting SQL Server: A Guide for Accidental DBAs[/url]