locked
How to Export data from a VS 2008 attached .mdf to MS SQL Server 2005? RRS feed

  • Question

  • Hi,

    for reason I will not get into, an asp project was created with the database attached directly to the project. All interactions iwth the database were done in VS 2008, which means the database has been compiled to version 655. The project referenced the .mdf file directly in order to establish a connection.

    In order to allow mutiple simultaneous connections to the database, i'd like to detach it from the project, change the connection string in the web.config and attach it to our instance of SQL Server 2005. However when I attempt to attach it, I get teh message that it is version 655 and it can only accept versions 612 and earlier. How can I export that data and table structure using the tools at my disposal (VS 2008 and MS SQL Server 2005) so that I can either import the data into a newly created database in MS SQL Server 2005 or how can I workaround the incompatibility to attach the database properly?

    Thank you for your time,

    Alex

    Thursday, August 5, 2010 8:25 PM

Answers

  • Hello,

    Version 655 is SQL Server 2008 RTM and Sp1.

    I would suggest you to install an evaluation copy of SQL Server 2008 (with SP1) or SQL Server 2008 R2, then use SSIS (Integration Services) of that newly created instance to export the data from the SQL Server 2008 instance to the SQL Server 2005 instance.

    Install that evaluation copy on a different computer if you want, and uninstall it after you finish transfer the data.

    Hope this helps.

    Regards,

    Alberto Morillo
    SQLCoffee.com

    • Marked as answer by AlexScript Tuesday, August 10, 2010 1:32 PM
    Friday, August 6, 2010 2:42 PM

All replies

  • Hello,

    Version 655 is SQL Server 2008 RTM and Sp1.

    I would suggest you to install an evaluation copy of SQL Server 2008 (with SP1) or SQL Server 2008 R2, then use SSIS (Integration Services) of that newly created instance to export the data from the SQL Server 2008 instance to the SQL Server 2005 instance.

    Install that evaluation copy on a different computer if you want, and uninstall it after you finish transfer the data.

    Hope this helps.

    Regards,

    Alberto Morillo
    SQLCoffee.com

    • Marked as answer by AlexScript Tuesday, August 10, 2010 1:32 PM
    Friday, August 6, 2010 2:42 PM
  • I'm not familiar with databases that are attached directly to a VS 2008 project but my understanding of that configuration is that you have an instance of SQL-Server Express already installed on your machine and used by VS 2008 to attach and detach this file each time it needs to access it.  So all you have to do would be to permanently attach this file (or a copy of it) to this instance of SQL-Server Express and from there, use one of the many available methods to transfer the design of your database and the data to a database on the SQL-Server 2005.

    You should be able to use VS 2008 to access and manage this instance of SQL-Server Express or you could also use SQL-Server Management Studio Express 2008 (SSMS-E 2008) to do it but I don't know if it's installed or not on your machine.  Of course, if it's not installed, all you have to do is to install it.


    Sylvain Lafontaine, ing.
    MVP - Access
    Blog/web site: http://coding-paparazzi.sylvainlafontaine.com
    Independent consultant and remote programming for Access and SQL-Server (French)

    Saturday, August 7, 2010 5:57 PM
  • Thanks for your reply, I now have a copy of SQL Server 2008 installed.

    When I attach my .mdf to the instance of the server and try to export, there are alot of options given to me, most of which ask me what my destination database is, but won't let me actually export to another file that I can then import to my instance of SQL Server 2005. Can you please detail teh steps I need to take to export my 2008 database to a file format compatible with SQL Server 2005? or can you at least point out a good resource article explain what I'm looking for?

    Thank you for your reply,

    Alex

    Monday, August 9, 2010 12:56 PM
  • Thanks for your help.

    Tuesday, August 10, 2010 1:33 PM