tags:

views:

391

answers:

2

The database is MS SQL Server Express 2005. The database is in simple mode.

I am trying to restore an existing database to a new server. I copied the MDF and LDF files to a new server. I attached the MDF and verified that the correct LDF was associated with it. After attaching the database, I compared the data from both databases and found that the new attached data was not current. Why?

A: 

Just detach database. Last transactions will be saved into database, and you can successfully attach database.

Alex_L
+1  A: 
  • Detach the database.
  • Copy the MDF and LDF files
  • Reattach on new server

I'm surprised you managed to copy the files at first because SQL Server locks the files exclusively.

You need to detach to cleanly "shut down" the database.

gbn