dbTalk Databases Forums  

Dropping Last record on import in DTS

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


Discuss Dropping Last record on import in DTS in the microsoft.public.sqlserver.dts forum.



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

Default Dropping Last record on import in DTS - 02-20-2004 , 04:51 PM






I am trying to import a text file in DTS. The file has 3
different record types each are a different length. The
table I am trying to import into has only 2 fields. The
first field is varchar(3) for the record type and the
second field is varchar(300). The last record is 80 char
and does end with a {CR}{LF}. I did read the bugs
regarding dropping the last record if it does not have the
row delimiter. Any thoughts.

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

Default Re: Dropping Last record on import in DTS - 02-21-2004 , 01:54 AM






Are you saying that you recieve a file with 3 fields but you oly want 2 of
them?

If yes then you have a few ways of doing it but my way would be to import
the whole file to a working table and do TSQL updates from there.


--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Mike Oleksak" <moleksak (AT) msa (DOT) com> wrote

Quote:
I am trying to import a text file in DTS. The file has 3
different record types each are a different length. The
table I am trying to import into has only 2 fields. The
first field is varchar(3) for the record type and the
second field is varchar(300). The last record is 80 char
and does end with a {CR}{LF}. I did read the bugs
regarding dropping the last record if it does not have the
row delimiter. Any thoughts.



Reply With Quote
  #3  
Old   
Mike Oleksak
 
Posts: n/a

Default Re: Dropping Last record on import in DTS - 02-23-2004 , 07:59 AM




No. The file has 3 different record types. Each record type has a
different formtat. So I wanted to import the file into 2 fields the
first is for the record type field which is 3 characters and the second
is 300 characters. The first record has a length of 207, records 2-5394
are 210 and record 5395 is 80 characters in length. Once the records are
imported the rest of the DTS Script will process each of the different
record types into different tables. The only way I have been able to get
this to work is to hand edit the last record to make it 210. This is not
a solution this needs to be an automated process.


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

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.