Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2004
    Location
    CA
    Posts
    8

    Unanswered: Exporting tables along with their primary and forgen keys and records

    Hi all,


    I’m trying to export 120 tables from SQL server 2000 to SQL server 2005 with their Primary and corresponding records.
    Is there way to do this?

    Thanks for any help.

    Abrahim

  2. #2
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    why not just restore from a backup? you can restore a 2000 backup to a 2005 server.

  3. #3
    Join Date
    May 2007
    Location
    somewhere in dbforums
    Posts
    221
    if you just want the script enterprise manager has a very easy method of exporting....
    go to your database, the tables of which u want to export, then go to tables in the table list section select the tables you want to export then right click -> All Taks -> Generate SQL Script

    there in the formatting and options tab you can select all the required options like primary, foreign, triggers.indexes...just about everything

    try this out and let me know is this what u want....

    or as said by jezemine.... directly restore the backup

  4. #4
    Join Date
    Feb 2004
    Location
    CA
    Posts
    8
    Hi all,

    In Enterprise manager Import\Export Under “Column Mappings” Tab I see:
    Create destination table.
    Delete rows in destination table.
    Append rows to destination table and enable identity insert.

    I tried all of the above options, and none does what I wanted.

    About restoring the database.

    There are couples of issues that we prefer not to use the restore function.


    Regards,

    Abrahim

  5. #5
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    If you want to generate scripts, here's a little console app I wrote to script out all objects and data in any 2000 or 2005 database. It's useful if you want to automate the scripting process, or if you hate GUIs.

    http://www.codeplex.com/scriptdb

    hope it's useful to you.
    Last edited by jezemine; 06-28-07 at 13:34.

  6. #6
    Join Date
    Feb 2004
    Location
    CA
    Posts
    8
    So,

    Is that mean Enterprise manager Import\Export is not capable of doing what I was trying to do?


    Thanks in advance,

    Abrahim

  7. #7
    Join Date
    May 2007
    Location
    somewhere in dbforums
    Posts
    221
    Click image for larger version. 

Name:	untitled1.JPG 
Views:	29 
Size:	134.4 KB 
ID:	7338

    Click image for larger version. 

Name:	untitled2.JPG 
Views:	35 
Size:	51.2 KB 
ID:	7339

    You never checked the right options..... kindly check the attachments i have added along with this thread and you will have a better idea.....


    also if you perform the following option you will still reach here
    Right Click on Database name -> All Tasks -> Generate SQL Script
    Click image for larger version. 

Name:	untitled.JPG 
Views:	34 
Size:	124.2 KB 
ID:	7340

    Alternatively a longer programmatic procedure
    http://www.databasejournal.com/featu...le.php/2205291

    for importing data present in these tables you can use the import/export wizard
    Last edited by nick.ncs; 06-29-07 at 02:39.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •