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."
- "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.
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.
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.
Got it right.
To get quick answer follow this link:
nice question.... new thing is added in my knowledge
You cannot get to the top by sitting on your bottom.
Viewing 8 posts - 16 through 22 (of 22 total)