Re: Restore of DB

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Thirumal (anonymous_at_discussions.microsoft.com)
Date: 02/20/04


Date: Thu, 19 Feb 2004 19:10:08 -0800

Hi,

This is interesting as I use to think that only cleanly
detached databases can be attached.

Thanks for all your views

Regards

Thirumal
>-----Original Message-----
>Hi All in my experience especially in this case I have
definitely used
>sp_attach_single_file_db and passing only the mdf file
location, the ldf
>file will be auto created and you should be fine.
committed transacions that
>were not physically written to disk(in controller cache)
will be lost
>obviously depends on yor cache settings
>
>--
>Olu Adedeji
>"Christian Smith" <csmith@digex.com> wrote in message
>news:OTMIEwx9DHA.4020@TK2MSFTNGP09.phx.gbl...
>> I thought sp_detach_db took some data out of master and
attached it to the
>> mdb. I didn't think attach would work without detach.
>>
>> Christian Smith
>>
>> "Steve Thompson" <SteveThompson@nomail.please> wrote in
message
>> news:uc%23X2Qx9DHA.1816@TK2MSFTNGP12.phx.gbl...
>> > > I think the .ldf and .mdf files would be on a
different
>> > > drive ( for example on drive D )when SQL Server was
up and
>> > > running, and as usual the guy would have formatted
Drive
>> > > C coz of some issues and Installed the SQL Server
again.
>> > > Does sp_attach_db suceed, as the database is not
detached?
>> >
>> > It should work, as long as you've got the mdf file
you can use the
>> > sp_attach_db, just specify the new file location.
>> >
>> > Steve
>> >
>> >
>>
>>
>
>
>.
>