views:

57

answers:

3

I simply copied my .mdf/.ldf files to another file and suddenly my Microsoft SQL 2008 database dies. I can't open these files on another system either. Can anyone explain what's happened? Any way to recover this application's database now?

+2  A: 

Did you stop the service or detach the files first?

T3hc13h
+1 That'd be my first guess as well.
Joe Stefanelli
A: 

Have you tried moving the database files back to where they were? (Specifically, stop SQL server, move files, start SQL Server).

Whenever I do this kind of work, I make copies of the files, and rename the original ones (from, say, MyData.mdf to xMyData.mdf). Makes it easier to back out when my fatfingers take over.

Philip Kelley
A: 

You are not supposed to copy files when the server is online.

if you want to copy when the server is online, you can right click on management studio , -> detach->

then copy the files to another instance , and choose attach on new server. remember you need to know the location of the files, before you detach, also you should be knowing, also the logins need to transfer.

Gigs