Results 1 to 5 of 5

Thread: Dts Export

  1. #1
    Join Date
    Feb 2004
    Location
    El Salvador
    Posts
    46

    Unanswered: Dts Export

    I am trying to export all the records from 6 different tables from sql server to a text file using the DTS wizard. I want all the info of the first table to appear first, then all the info of the second table, etc.
    Any ideas on how to do this type of query?
    thanks in advance.
    Last edited by diegocro; 03-02-04 at 10:13.

  2. #2
    Join Date
    Feb 2004
    Location
    San Antonio, TX
    Posts
    565
    Quote
    "I am trying to export all the registries from 6 different tables"

    what do you mean by registries?

  3. #3
    Join Date
    Feb 2004
    Location
    El Salvador
    Posts
    46
    I think I made the wrong translation...

    I ment all the data in each table

  4. #4
    Join Date
    Feb 2004
    Location
    Dublin, Ireland
    Posts
    5
    How about
    Select 1 as 'Sort' , T1.* from table1 T1
    Union
    Select 2 as 'Sort' , T2.* from table1 T2
    .
    .
    .
    .

    order by sort

    ??

  5. #5
    Join Date
    Feb 2004
    Location
    El Salvador
    Posts
    46
    I get the following error trying to use the UNION operator:

    "All queries in an SQL statement containing a UNION operator must have an equal number of expressions in their target lists."

    The number and the order of the columns are not identical in all queries...
    Last edited by diegocro; 03-02-04 at 10:11.

Posting Permissions

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