SQL Server Performance

Export using DTS

Discussion in 'SQL Server DTS-Related Questions' started by nilayinc, Aug 3, 2003.

  1. nilayinc New Member

    Hi,

    I need to export 2 table information to single fixed length flat file structure (fixed length is maximum length of both the table). There would be a field which would specify the data is from which table.
    Although from top it sound simple as append the file directly from table.. but it is not. Because the two table that I want to export to single file has parent child relationship and the way record should appear is that one record of parent then all records of child for that parent and so on..

    I am stuck at very begining as what is the way to proceed. One way which I am thinking is to create a temporary table which would hold the field definition of all and populate this table using normal SQL statement and then transfer to flat file. But seems very basic. Any other suggestions.

    Thanks and regards,
    Nilay.
  2. gaurav_bindlish New Member

    Did you try joining the data based on the relationship and then exporting the data into the flat file using the join query as input? This will create a bigger file but the hastels and chances of error will be less.

    Gaurav
    Moderator
    Man thrives, oddly enough, only in the presence of a challenging environment- L. Ron Hubbard
  3. nilayinc New Member

    Ya.. seems good.. If I understand correctly then the result query should contain all the columns of both the table. Right.
  4. gaurav_bindlish New Member

    That's correct... So this will be one query and will generate a single file having the same file structure through out.

    Gaurav
    Moderator
    Man thrives, oddly enough, only in the presence of a challenging environment- L. Ron Hubbard

Share This Page