all groups > sql server dts > february 2004 >
You're in the

sql server dts

group:

Dropping Last record on import in DTS


Dropping Last record on import in DTS Mike Oleksak
2/20/2004 2:51:25 PM
sql server dts:
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
Re: Dropping Last record on import in DTS Allan Mitchell
2/21/2004 7:54:39 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


[quoted text, click to view]

Re: Dropping Last record on import in DTS Mike Oleksak
2/23/2004 5:59:58 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 ***
AddThis Social Bookmark Button