|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Yesterday @ 7:11 AM
Points: 877,
Visits: 1,159
|
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Yesterday @ 3:46 AM
Points: 1,631,
Visits: 2,031
|
|
Am I reading this right? FOR ATTACH
FOR ATTACH [ WITH < attach_database_option > ] Specifies that the database is created by attaching an existing set of operating system files. There must be a <filespec> entry that specifies the primary file. The only other <filespec> entries required are those for any files that have a different path from when the database was first created or last attached. A <filespec> entry must be specified for these files.
FOR ATTACH requires the following:
All data files (MDF and NDF) must be available.
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 contrast, for a read-only database, the log cannot be rebuilt because the primary file cannot be updated. Therefore, when you attach a read-only database with a log that is unavailable, you must provide the log files, or the files in the FOR ATTACH clause.
Given the assumtions in the question, I think both answers are correct.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 8:31 AM
Points: 1,039,
Visits: 121
|
|
Seems to me that both answers can be correct.
Ian
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 9:52 AM
Points: 1,356,
Visits: 4,761
|
|
Got it right, seemed an easy guess  But when I then did a bit of research, it appears that FOR ATTACH will also work if the database had a single log file.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Today @ 4:44 AM
Points: 1,087,
Visits: 692
|
|
| I did divine the correct answer, however I would agree with 'Just a number' that both options would work.
|
|
|
|
|
SSChasing Mays
      
Group: General Forum Members
Last Login: 2 days ago @ 12:58 PM
Points: 622,
Visits: 308
|
|
| Ok, I got it wrong after reading the books online specifically on that subject. I agree, with single log file, both answers are correct.
|
|
|
|
|
SSChasing Mays
      
Group: General Forum Members
Last Login: Thursday, February 07, 2013 7:38 AM
Points: 616,
Visits: 215
|
|
ipounder (6/21/2012) Seems to me that both answers can be correct.
Ian
I agree
The impossible can be done at once, miracles may take a little longer
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 2:04 PM
Points: 1,150,
Visits: 1,455
|
|
David P Fisher (6/21/2012)
ipounder (6/21/2012) Seems to me that both answers can be correct.
IanI agree 
Anybody care to test it? 
Thanks for the question.
BTW, love the cat with the mice crawling over it.
Please don't go. The drones need you. They look up to you.
|
|
|
|
|
UDP Broadcaster
      
Group: General Forum Members
Last Login: Friday, May 10, 2013 3:15 AM
Points: 1,476,
Visits: 1,943
|
|
Thomas Abraham (6/21/2012)
David P Fisher (6/21/2012)
ipounder (6/21/2012) Seems to me that both answers can be correct.
IanI agree  Anybody care to test it?  Thanks for the question. BTW, love the cat with the mice crawling over it.
Works just fine to attach a database with just "for attach" with only one log file.
/T
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 2:04 PM
Points: 1,150,
Visits: 1,455
|
|
tommyh (6/21/2012) Works just fine to attach a database with just "for attach" with only one log file.
/T
I figured it would. But it's nice to have it confirmed. (Yes, I don't always trust BOL.) Thanks for the effort!
Please don't go. The drones need you. They look up to you.
|
|
|
|