none
Primary database file

    Question

  • I need to copy a database file (.mdf) and transaction log file (.ldf) in SQl Server Express 2008 so it can be emailed. The recieving party will need to attach the database to sql server 2008 and use the database without loss of data.

    Please provide instruction on how to perform this task.

    Thanks

    Tuesday, October 08, 2013 6:14 PM

Answers

All replies

    • Proposed as answer by vr.babu Wednesday, October 09, 2013 1:00 PM
    • Marked as answer by jimmy2f Wednesday, October 09, 2013 1:40 PM
    Tuesday, October 08, 2013 6:18 PM
  • Unless there is a special reason for sending a copy of MDF/LDF, I would suggest sending a backup file which can be restored on the target location.

    My Blog

    • Proposed as answer by vr.babu Wednesday, October 09, 2013 1:00 PM
    • Marked as answer by jimmy2f Wednesday, October 09, 2013 1:21 PM
    Tuesday, October 08, 2013 10:50 PM
  • Thank you for the advice!
    Wednesday, October 09, 2013 12:55 PM
  • Thank you for your input! The link has very clear instructions.

    I understand the Detach and attach process. This will work in some cases for me.

    I am running an application that uses sql for its database and operates on our network. There is an software update available for the application. Before updating the network version I am doing some testing on my local machine to determine if a few processes will work. I am running SQL Server Express 2008 on my PC. I have several functioning databases in SQL. In order to complete this testing I need to create an exact copy of an existing database so I can transfer data between the databases using the application.

    The instructions from the  posted link mentioned running an addtional instance of SQL. Any advice on how to do this? With a second instance of SQL i should be able to restore a .bak file... i think?

    I am not an IT person and not very familiar with SQL. I am the end user of this specific application and the only person in my company of 7000+ employees using it. I am getting very little support from my IT department.  ANY information or links you can provide will be much apprecatied!

    Wednesday, October 09, 2013 1:20 PM
  • The instructions from the  posted link mentioned running an addtional instance of SQL. Any advice on how to do this? With a second instance of SQL i should be able to restore a .bak file... i think?

    Hello,

    If you want to keep a database in the current SQL Server instance and also need a copy on another instance, then you can backup the database and restore to the second instance.
    (Note:you can't restore a backup from a higher version of SQL Server on a lower version of SQL Server. If you restore the SQL Server 2008 database to SQL Server 2012,the database is automatically upgraded.)

    Reference:http://technet.microsoft.com/en-us/library/ms187048.aspx

    Regards,
    Fanny Liu


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

    Thursday, October 10, 2013 8:42 AM