Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 123»»»

Create Database Expand / Collapse
Author
Message
Posted Wednesday, June 20, 2012 10:30 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Thursday, April 10, 2014 3:42 AM
Points: 890, Visits: 1,179
Comments posted to this topic are about the item Create Database

Thanks
Post #1319073
Posted Thursday, June 21, 2012 1:00 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 5:02 AM
Points: 1,652, Visits: 2,075
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.
Post #1319113
Posted Thursday, June 21, 2012 3:01 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, April 03, 2014 9:52 AM
Points: 1,319, Visits: 176
Seems to me that both answers can be correct.

Ian
Post #1319159
Posted Thursday, June 21, 2012 3:02 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 7:56 AM
Points: 1,658, Visits: 6,001
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.
Post #1319160
Posted Thursday, June 21, 2012 3:03 AM


UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: Today @ 7:17 AM
Points: 1,490, Visits: 975
I did divine the correct answer, however I would agree with 'Just a number' that both options would work.
Post #1319161
Posted Thursday, June 21, 2012 3:15 AM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Friday, February 28, 2014 5:26 AM
Points: 710, Visits: 373
Ok, I got it wrong after reading the books online specifically on that subject. I agree, with single log file, both answers are correct.
Post #1319167
Posted Thursday, June 21, 2012 3:27 AM


SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing 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
Post #1319172
Posted Thursday, June 21, 2012 6:23 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 9:26 AM
Points: 1,621, Visits: 2,030
David P Fisher (6/21/2012)
ipounder (6/21/2012)
Seems to me that both answers can be correct.

Ian


I 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.
Connect to me on LinkedIn
Post #1319244
Posted Thursday, June 21, 2012 7:03 AM
UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: Thursday, November 21, 2013 11:33 PM
Points: 1,481, Visits: 1,959
Thomas Abraham (6/21/2012)
David P Fisher (6/21/2012)
ipounder (6/21/2012)
Seems to me that both answers can be correct.

Ian


I 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
Post #1319265
Posted Thursday, June 21, 2012 7:25 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 9:26 AM
Points: 1,621, Visits: 2,030
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.
Connect to me on LinkedIn
Post #1319275
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse