dbTalk Databases Forums  

DTS create text file, multiple output lines per record

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss DTS create text file, multiple output lines per record in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gary
 
Posts: n/a

Default DTS create text file, multiple output lines per record - 03-04-2005 , 09:23 AM






I know very little about DTS (yet). I need to export to a text file. Each
SQL 2000 record needs to create multiple lines in the text file. What's the
best way to do this? I'm wondering if I need to use the FileSystemObject, or
if I can do this in a more direct manner.

Thank you.

Gary



Reply With Quote
  #2  
Old   
Simon Worth
 
Posts: n/a

Default Re: DTS create text file, multiple output lines per record - 03-04-2005 , 09:35 AM






I'm not sure I understand the requirment here. Can you explain a little
further what you are trying to accomplish?

--
Simon Worth


"Gary" <GAry> wrote

Quote:
I know very little about DTS (yet). I need to export to a text file. Each
SQL 2000 record needs to create multiple lines in the text file. What's
the
best way to do this? I'm wondering if I need to use the FileSystemObject,
or
if I can do this in a more direct manner.

Thank you.

Gary





Reply With Quote
  #3  
Old   
Gary
 
Posts: n/a

Default Re: DTS create text file, multiple output lines per record - 03-04-2005 , 10:04 AM



I have a SQL Server 2000 table that contains data that needs to be exported
to an application as a text file. Each record in the table must be
transformed into multiple lines in the text file. From what I can read of
DTS, it expects to do a one-to-one transform, i.e., if I specify my SQL
table as input and the text file as output, each record will create only one
line in the text file.

How do I create multiple text file lines from each record? Just had another
thought. Could I specify that a field of the output record (in the text
file) gets filled in with a CR/LF, thus adding a line to the text file, yet
DTS seeing the output as only one record?

Gary

"Simon Worth" <REMOVEFIRST_simon.worth (AT) gmail (DOT) com> wrote

Quote:
I'm not sure I understand the requirment here. Can you explain a little
further what you are trying to accomplish?

--
Simon Worth


"Gary" <GAry> wrote

I know very little about DTS (yet). I need to export to a text file.
Each
SQL 2000 record needs to create multiple lines in the text file. What's
the
best way to do this? I'm wondering if I need to use the
FileSystemObject,
or
if I can do this in a more direct manner.

Thank you.

Gary



Reply With Quote
  #4  
Old   
Simon Worth
 
Posts: n/a

Default Re: DTS create text file, multiple output lines per record - 03-04-2005 , 10:18 AM



I've never actually tried coding a carriage return and/or line feed to the
end of a column. Sounds to me like it would in fact work to create a new
line in the text file.

Are there certain instances when you want to add new lines, or is it always
going to be multiple lines for any given record?

--
Simon Worth


"Gary" <GAry> wrote

Quote:
I have a SQL Server 2000 table that contains data that needs to be
exported
to an application as a text file. Each record in the table must be
transformed into multiple lines in the text file. From what I can read of
DTS, it expects to do a one-to-one transform, i.e., if I specify my SQL
table as input and the text file as output, each record will create only
one
line in the text file.

How do I create multiple text file lines from each record? Just had
another
thought. Could I specify that a field of the output record (in the text
file) gets filled in with a CR/LF, thus adding a line to the text file,
yet
DTS seeing the output as only one record?

Gary

"Simon Worth" <REMOVEFIRST_simon.worth (AT) gmail (DOT) com> wrote in message
news:#OWkB$MIFHA.3588 (AT) TK2MSFTNGP14 (DOT) phx.gbl...
I'm not sure I understand the requirment here. Can you explain a little
further what you are trying to accomplish?

--
Simon Worth


"Gary" <GAry> wrote in message
news:e9bK43MIFHA.904 (AT) tk2msftngp13 (DOT) phx.gbl...
I know very little about DTS (yet). I need to export to a text file.
Each
SQL 2000 record needs to create multiple lines in the text file.
What's
the
best way to do this? I'm wondering if I need to use the
FileSystemObject,
or
if I can do this in a more direct manner.

Thank you.

Gary





Reply With Quote
  #5  
Old   
Simon Worth
 
Posts: n/a

Default Re: DTS create text file, multiple output lines per record - 03-04-2005 , 10:22 AM



The more I think about it, I don't think you'll be able to accomplish this
within a data pump task (and I might just be missing something here and be
totally wrong), but you could easily do it within an ActiveX script, and
write the results of the query out using a database connection and
recordset.

--
Simon Worth


"Gary" <GAry> wrote

Quote:
I have a SQL Server 2000 table that contains data that needs to be
exported
to an application as a text file. Each record in the table must be
transformed into multiple lines in the text file. From what I can read of
DTS, it expects to do a one-to-one transform, i.e., if I specify my SQL
table as input and the text file as output, each record will create only
one
line in the text file.

How do I create multiple text file lines from each record? Just had
another
thought. Could I specify that a field of the output record (in the text
file) gets filled in with a CR/LF, thus adding a line to the text file,
yet
DTS seeing the output as only one record?

Gary

"Simon Worth" <REMOVEFIRST_simon.worth (AT) gmail (DOT) com> wrote in message
news:#OWkB$MIFHA.3588 (AT) TK2MSFTNGP14 (DOT) phx.gbl...
I'm not sure I understand the requirment here. Can you explain a little
further what you are trying to accomplish?

--
Simon Worth


"Gary" <GAry> wrote in message
news:e9bK43MIFHA.904 (AT) tk2msftngp13 (DOT) phx.gbl...
I know very little about DTS (yet). I need to export to a text file.
Each
SQL 2000 record needs to create multiple lines in the text file.
What's
the
best way to do this? I'm wondering if I need to use the
FileSystemObject,
or
if I can do this in a more direct manner.

Thank you.

Gary





Reply With Quote
  #6  
Old   
Gary
 
Posts: n/a

Default Re: DTS create text file, multiple output lines per record - 03-04-2005 , 10:50 AM



It's a very fixed output format - it just must be written over multiple
output lines. It will be the same for each record.


"Simon Worth" <REMOVEFIRST_simon.worth (AT) gmail (DOT) com> wrote

Quote:
I've never actually tried coding a carriage return and/or line feed to the
end of a column. Sounds to me like it would in fact work to create a new
line in the text file.

Are there certain instances when you want to add new lines, or is it
always
going to be multiple lines for any given record?

--
Simon Worth


"Gary" <GAry> wrote

I have a SQL Server 2000 table that contains data that needs to be
exported
to an application as a text file. Each record in the table must be
transformed into multiple lines in the text file. From what I can read
of
DTS, it expects to do a one-to-one transform, i.e., if I specify my SQL
table as input and the text file as output, each record will create only
one
line in the text file.

How do I create multiple text file lines from each record? Just had
another
thought. Could I specify that a field of the output record (in the text
file) gets filled in with a CR/LF, thus adding a line to the text file,
yet
DTS seeing the output as only one record?

Gary

"Simon Worth" <REMOVEFIRST_simon.worth (AT) gmail (DOT) com> wrote in message
news:#OWkB$MIFHA.3588 (AT) TK2MSFTNGP14 (DOT) phx.gbl...
I'm not sure I understand the requirment here. Can you explain a
little
further what you are trying to accomplish?

--
Simon Worth


"Gary" <GAry> wrote in message
news:e9bK43MIFHA.904 (AT) tk2msftngp13 (DOT) phx.gbl...
I know very little about DTS (yet). I need to export to a text file.
Each
SQL 2000 record needs to create multiple lines in the text file.
What's
the
best way to do this? I'm wondering if I need to use the
FileSystemObject,
or
if I can do this in a more direct manner.

Thank you.

Gary







Reply With Quote
  #7  
Old   
Gary
 
Posts: n/a

Default Re: DTS create text file, multiple output lines per record - 03-04-2005 , 10:51 AM



I wondered if I might need to use a FileSystemObject in an ActiveX script
that is opened early, kept as a global variable, and written to for each
record. But it sounds like it is possible to do. Thanks for your input.

Gary

"Simon Worth" <REMOVEFIRST_simon.worth (AT) gmail (DOT) com> wrote

Quote:
The more I think about it, I don't think you'll be able to accomplish this
within a data pump task (and I might just be missing something here and be
totally wrong), but you could easily do it within an ActiveX script, and
write the results of the query out using a database connection and
recordset.

--
Simon Worth


"Gary" <GAry> wrote

I have a SQL Server 2000 table that contains data that needs to be
exported
to an application as a text file. Each record in the table must be
transformed into multiple lines in the text file. From what I can read
of
DTS, it expects to do a one-to-one transform, i.e., if I specify my SQL
table as input and the text file as output, each record will create only
one
line in the text file.

How do I create multiple text file lines from each record? Just had
another
thought. Could I specify that a field of the output record (in the text
file) gets filled in with a CR/LF, thus adding a line to the text file,
yet
DTS seeing the output as only one record?

Gary

"Simon Worth" <REMOVEFIRST_simon.worth (AT) gmail (DOT) com> wrote in message
news:#OWkB$MIFHA.3588 (AT) TK2MSFTNGP14 (DOT) phx.gbl...
I'm not sure I understand the requirment here. Can you explain a
little
further what you are trying to accomplish?

--
Simon Worth


"Gary" <GAry> wrote in message
news:e9bK43MIFHA.904 (AT) tk2msftngp13 (DOT) phx.gbl...
I know very little about DTS (yet). I need to export to a text file.
Each
SQL 2000 record needs to create multiple lines in the text file.
What's
the
best way to do this? I'm wondering if I need to use the
FileSystemObject,
or
if I can do this in a more direct manner.

Thank you.

Gary







Reply With Quote
  #8  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: DTS create text file, multiple output lines per record - 03-04-2005 , 10:59 AM



You can certainly take in 1 line and convert it to many lines in the
output.

Have a look here

Processing The Same Row More Than Once
(http://www.sqldts.com/default.aspx?266)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.