Importing Data Into New Database

Discussion in 'Databases' started by JohnBF, Jun 12, 2008.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I've got a new new empty MS SQL2005 database deployed at DiscountAsp. One of the tables is identical to a table in an otherwisedifferent database. I'd like to populate this table in the new database with the datafrom the older database. What's the best strategy?

    The tools at hand are all the Express edition applications, including SQL Server Management Express. My learning curve in VB.Net, ASP.Net, ADO.Net and SQL is climbing rapidly, but I haven't figured out how to do this. I can get the data from the old database into an Excel spreadsheet, or any other kind of file, but I'm not sure of the best strategy for getting it up to the new database.

    Can someone point me in the right direction?

    Thanks!

    /John
     
  2. You've got a good attitude about this bro. [​IMG]

    There have been so many requests now I'm definitely going to create a series of videos showing how this can be done.

    You can't pump data with the Express versions but you can generate scripts.

    1. Load SQL Express.
    2. Connect to the local DB you want to export.
    3. Right click on the table and generate scripts for the objects/tables and records.
    4. Then connect to the DASP SQL server and execute those scripts.


    Make a backup of your blank DASP SQL DB first, so you have something to fall back on, and start over if need be.


    Lemme know what you need and I'll help.
    Mark
     
  3. Thanks! By the way, I learned how to connect SQL Server Management Studioto a remote database from your video -it's a great way to learn.

    So I connected to the database which has the existing data and right-clicked on the table. If I select "Script Table As" I can choose among Create To, Drop To, Select To, Insert To, Update To, and Delete To.

    If I do "Select To" and New Query Editor, and run the query I've got all the data in the results. Now I'm out of ideas...

    /John
     
  4. I'll have some new things to report today, great news for Express SQL users actually.

    Note:
    My Vista Dev box only runs full versions of SQL Server.
    I've got an XP Pro SP3 machine here with nothing but Express products on it, to help you guys.

    Apparently, from what the Microsoft SQL Express team has said...
    SQL Server Express 2008 is available for download and it can now import and export!

    Won't that be dandy. [​IMG]
     
  5. When I have to do this I typically copy the data into an access database, transfer the access db to the target machine and write a small asp script that inserts the data into the new table.

    You have to be careful if you have unique id's that have to be preserved, but otherwise it is relatively straightforward.

    marc
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page