Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Does database detach on shutdown?

Author  Topic 

Directlinq
Starting Member

8 Posts

Posted - 2009-10-13 : 03:12:18
Hi This is simialar to my other post but i thought it deserved a new thread. I applogise if this is wrong?

When a computer with mysql server shuts down is the the database detached on shutdown. So if i pulled the hard drive out and put the .mdf and .ldf file into another machine (So i have not really detached it.) edited it with Microsoft SQL Server Management Studio Express until i got my original computer hardware fixed. Then put the harddrive back in the original machine with the updated .mdf and .ldf files. Would the sql server be able to use the updated file?
As techniacally i did not detach it. Then attached it to MSSMSE, Edited, Then detached. And not re-attached.

Many Thanks

Directlinq
Starting Member

8 Posts

Posted - 2009-10-13 : 03:59:53
I take it i got people stummped?
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2009-10-13 : 07:13:59
No, it's not technically detached, and you risk corrupting the database with the procedure you describe. You can run sp_detach_db to cleanly detach the database and move the files and drives around as you like, just make sure to detach it each time beforehand.
Go to Top of Page
   

- Advertisement -