Create Database

  • Pretty easy if you had to attach the AdventureWorks MDF files multiple times 😀

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • A simple one for me thank you very much.

    “When I hear somebody sigh, ‘Life is hard,’ I am always tempted to ask, ‘Compared to what?’” - Sydney Harris

  • Thanks for the question.

    I agree that both options may be correct, depending if the database was shut down cleanly AND only one log file existed for the database file. BOL specifies:

    - "If multiple log files exist, they must all be available."

    and

    - "If a read/write database has a single log file that is currently unavailable, and if the database was shut down with no users or open transactions before the attach operation, FOR ATTACH automatically rebuilds the log file and updates the primary file."

    in the FOR_ATTACH option.

    "El" Jerry.

    "El" Jerry.

    "A watt of Ottawa" - Gerardo Galvan

    To better understand your help request, please follow these best practices.[/url]

  • Like those who commented earlier, I think both options work (provided there was a clean shutdown). I picked the second because although I knew the first optioopn would also work I guessed that the question's author didn't.

    Tom

  • Why don't you remove a question or clarify it when it is clearly wrong and both answers are working.

    I have tested it on my SQL Server and the "wrong" option works fine.

    Soren

  • Got it right.

  • +1 🙂

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • nice question.... new thing is added in my knowledge

    manik

    *******

    Manik
    You cannot get to the top by sitting on your bottom.

Viewing 8 posts - 16 through 22 (of 22 total)

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