dbTalk Databases Forums  

Question on "Read File" transform

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


Discuss Question on "Read File" transform in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Peter A. Schott
 
Posts: n/a

Default Question on "Read File" transform - 09-08-2004 , 02:31 PM






We're going to get back a file with row-types stored in the first 3 characters
of each row. That will determine the data layout for each row. The rows vary
in length.

Will the "Read File" transform allow me to import the data row by row into SQL
so I can then work on the various sets of data or is there a better way to
handle this?

Tried looking at the examples of "Read File" on the web and in BOL, but wasn't
sure exactly how to use for my purposes or if this would do what I need it to
do.

Any ideas on how to handle data sets like this? I know that it must be
possible short of moving up to Yukon (tempting though that may be).

Thanks in advance.

-Pete Schott

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

Default Re: Question on "Read File" transform - 09-08-2004 , 03:17 PM






The ReadFile transformation will read a file into SQL Server

Read File Transformation
(http://www.sqldts.com/default.aspx?304)

Rows varying in length is in itself no big deal.

Can you show a part of the file and maybe show the destination?

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know


"Peter A. Schott" <pschott (AT) no (DOT) spamm.hear.drivefinancial.com> wrote in
message news:9bnuj0h3bqhdi4l9s2tbhgq09dqun4pqj1 (AT) 4ax (DOT) com...
Quote:
We're going to get back a file with row-types stored in the first 3
characters
of each row. That will determine the data layout for each row. The rows
vary
in length.

Will the "Read File" transform allow me to import the data row by row into
SQL
so I can then work on the various sets of data or is there a better way to
handle this?

Tried looking at the examples of "Read File" on the web and in BOL, but
wasn't
sure exactly how to use for my purposes or if this would do what I need it
to
do.

Any ideas on how to handle data sets like this? I know that it must be
possible short of moving up to Yukon (tempting though that may be).

Thanks in advance.

-Pete Schott



Reply With Quote
  #3  
Old   
Peter A. Schott
 
Posts: n/a

Default Re: Question on "Read File" transform - 09-08-2004 , 06:47 PM



Well, ideally I'd love a way to read in the
000............................................. rows
and use the appropriate fixed-length values for those at the same time as
reading the
001............................................. rows and using the
appropriate fixed-length values for those.

Seems that the Bulk Insert task actually reads each line of the file into its
own row. That could work for me. It's not ideal as I then have to break down
the rows in the table using a bunch of SUBSTRING commands, but it could work.

Is there a way in DTS to read each row and break it up based on some portion
of that row? (If not in 2000, is it possible in Yukon?)

Thanks.

-Pete

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote:

Quote:
The ReadFile transformation will read a file into SQL Server

Read File Transformation
(http://www.sqldts.com/default.aspx?304)

Rows varying in length is in itself no big deal.

Can you show a part of the file and maybe show the destination?

--


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

Default Re: Question on "Read File" transform - 09-09-2004 , 12:01 AM



BULK INSERT will split on delimiters as well.

You want to treat the whole row as a single row.

Yukon will have a much better GUI for you yes (If I understand what you are
trying to do)

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know


"Peter A. Schott" <pschott (AT) no (DOT) spamm.hear.drivefinancial.com> wrote in
message news:qb6vj0l07na8evnfhto7u208ks96jpkn05 (AT) 4ax (DOT) com...
Quote:
Well, ideally I'd love a way to read in the
000............................................. rows
and use the appropriate fixed-length values for those at the same time as
reading the
001............................................. rows and using the
appropriate fixed-length values for those.

Seems that the Bulk Insert task actually reads each line of the file into
its
own row. That could work for me. It's not ideal as I then have to break
down
the rows in the table using a bunch of SUBSTRING commands, but it could
work.

Is there a way in DTS to read each row and break it up based on some
portion
of that row? (If not in 2000, is it possible in Yukon?)

Thanks.

-Pete

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote:

The ReadFile transformation will read a file into SQL Server

Read File Transformation
(http://www.sqldts.com/default.aspx?304)

Rows varying in length is in itself no big deal.

Can you show a part of the file and maybe show the destination?

--




Reply With Quote
  #5  
Old   
Peter A. Schott
 
Posts: n/a

Default Re: Question on "Read File" transform - 09-13-2004 , 05:17 PM



Guess it's time to head over to the Yukon forums as well. Didn't see that
Bulk Insert would split on delimiters. I'll take a look at that. Is that the
command or the DTS operation?

Basic format:

000.........................................
001........................
001........................
000.........................................
001........................
000.........................................
001........................
001........................
001........................


So on and so on. Each type of row has the same length and fixed-length field
definitions. If I could get that on the fly it would be great. Directly into
my tables.

Thanks.

-Pete

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote:

Quote:
BULK INSERT will split on delimiters as well.

You want to treat the whole row as a single row.

Yukon will have a much better GUI for you yes (If I understand what you are
trying to do)

--


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

Default Re: Question on "Read File" transform - 09-14-2004 , 12:04 AM



DTS BI and TSQL BI are the same just a pretty wrapper is provided in DTS

OK So from what you have here it looks as though you have different table
rows in each file. The table is defined by the first string (000,001)
If the meta data is the same then when you look in Yukon you are looking for
the conditional split transform.


--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know


"Peter A. Schott" <pschott (AT) no (DOT) spamm.hear.drivefinancial.com> wrote in
message newsu6ck0pook0npoumr9jj46tc2vec96n629 (AT) 4ax (DOT) com...
Quote:
Guess it's time to head over to the Yukon forums as well. Didn't see that
Bulk Insert would split on delimiters. I'll take a look at that. Is that
the
command or the DTS operation?

Basic format:

000.........................................
001........................
001........................
000.........................................
001........................
000.........................................
001........................
001........................
001........................


So on and so on. Each type of row has the same length and fixed-length
field
definitions. If I could get that on the fly it would be great. Directly
into
my tables.

Thanks.

-Pete

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote:

BULK INSERT will split on delimiters as well.

You want to treat the whole row as a single row.

Yukon will have a much better GUI for you yes (If I understand what you
are
trying to do)

--




Reply With Quote
  #7  
Old   
Peter A. Schott
 
Posts: n/a

Default Re: Question on "Read File" transform - 09-20-2004 , 03:22 PM



Thanks. I found it. Unfortunately, we're stuck with Plain Ol' SQL2000 now.
Have to do a Bulk Import, copy data out based on the first couple of
characters, then work with it from there. I was able to get the conditional
split mostly working. Had a little trouble with my derived column transform
after that, but I didn't do much more than verify it worked. Probably had a
start position or two wrong when I programmed it - not necessarily a bug.

-Pete

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote:

Quote:
DTS BI and TSQL BI are the same just a pretty wrapper is provided in DTS

OK So from what you have here it looks as though you have different table
rows in each file. The table is defined by the first string (000,001)
If the meta data is the same then when you look in Yukon you are looking for
the conditional split transform.


--


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.