none
Export table data from SQL Server 2005

    Question

  • Hi. I'm using SQL Server 2005 Developer Edition with Management Studio Express. How do I export the data from my tables so that they can be easily inserted on another database? INSERT statements would be the best way but I've not found a way to do this. Thank you.
    Sunday, September 14, 2008 1:57 AM

Answers

  • Thank you, all, for your great responses. I found a stored procedure on this site that does what I'm looking for: http://vyaskn.tripod.com/code.htm#inserts

    I realized that I wasn't very clear when I asked the question: I don't have access to the remote database where the data needs to be inserted, so INSERT statements needed to be generated for each row in each user table and stored in a *.SQL file. Then the sys admin on the production system will run the INSERT statements and populate the tables. Not very efficient, I know, but that's how it is for this one-time import of seed data.

    However, I've successfully exported the database objects to script files via the Management Studio Express tool.

    Thank you again for your great suggestions and sorry I wasn't clear
    Sunday, September 14, 2008 11:01 PM

All replies

  • Create the Database you want to copy the data to

    (Right Click On Databases | Select New Database | Enter Database Name | Click Ok )

    Right Click on your Database

    Choose Export Data

    Choose Your Source Database

    Choose Your Database you just created as the Destination

    Select all the objects in the Database

    Click on Finish and it will copy all your data fromone database to another.

     

    www.sqldatabasics.com

     

    Sunday, September 14, 2008 5:40 AM
  •  

    You can use Import/export wizard to move data from one database to another.
    Sunday, September 14, 2008 5:42 AM
  • Thank you, all, for your great responses. I found a stored procedure on this site that does what I'm looking for: http://vyaskn.tripod.com/code.htm#inserts

    I realized that I wasn't very clear when I asked the question: I don't have access to the remote database where the data needs to be inserted, so INSERT statements needed to be generated for each row in each user table and stored in a *.SQL file. Then the sys admin on the production system will run the INSERT statements and populate the tables. Not very efficient, I know, but that's how it is for this one-time import of seed data.

    However, I've successfully exported the database objects to script files via the Management Studio Express tool.

    Thank you again for your great suggestions and sorry I wasn't clear
    Sunday, September 14, 2008 11:01 PM
  •  

    Hey arc_dev

    that was amazing

    Thanks for sharing.

    Monday, September 15, 2008 11:42 AM