Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2003
    Posts
    212

    Unanswered: SQL for export tables

    Is there ne sql for exportting tables within the same server but into different database. I'm using SQL server 2000.

  2. #2
    Join Date
    Oct 2003
    Location
    Sweden
    Posts
    45
    One easy way is to right click database in Enterprise Manager choose All Tasks->Export
    That will perform it as a DTS package that you can save and schedule.

    Performancewise I guess it would be better to do a SELECT INTO followed by an ALTER TABLE if necessary.

    I do not know of any specific sql function for exporting tables between databases though.

  3. #3
    Join Date
    Sep 2003
    Posts
    212
    I want to export some tables. But i want to make a make a job for it. So that it is all automated. I know the wizard in SQL server does a good job but, is it possible to get an equivalent SQL script for what the Export wizard does?

  4. #4
    Join Date
    Oct 2003
    Location
    Sweden
    Posts
    45
    Sure!
    In the final step just choose to save the package instead of executing it and then open that newly created DTS package and investigate the code generated for the various steps.

    Most likely the actual copying of data will not have been implemented very efficiently, and not using pure SQL, but I'm sure just copying raw data will not be a problem for you.

  5. #5
    Join Date
    Sep 2003
    Posts
    212
    Originally posted by vmlal
    I want to export some tables. But i want to make a make a job for it. So that it is all automated. I know the wizard in SQL server does a good job but, is it possible to get an equivalent SQL script for what the Export wizard does?
    One way is to save the DTS package in the wizard itself.

  6. #6
    Join Date
    Sep 2003
    Posts
    212
    and then schedule this package in the job as one of the steps.

Posting Permissions

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