dbTalk Databases Forums  

Importing Text file without leading zeros

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


Discuss Importing Text file without leading zeros in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
DTS Deleting Leading Zero's
 
Posts: n/a

Default Importing Text file without leading zeros - 10-07-2004 , 04:11 PM






How can I import text data from IBM DBI file with leading zeros? Once this
data is imported into SQL, datatype will not convert from char to money,
maybe because of the hyphen that represents a negative number.

example of data:

Payment remit date patient name
000000-1247 09/08/03 Jane Doe
0000001247 09/08/03 Jane Doe

I need to delete the zeros in the DTS process so that it looks like this:

Payment remit date patient name
($12.47) 09/08/03 Jane Doe
$12.47 09/08/03 Jane Doe

Can anyone help me with this problem?

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

Default Re: Importing Text file without leading zeros - 10-09-2004 , 06:01 AM






So what you do is either

1. Import the file to a staging table AS IS and then use TSQL to only grab
the part of the field that you require
2. You use an Active Script transform to do this.

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com


"DTS Deleting Leading Zero's" <DTS Deleting Leading Zero's
@discussions.microsoft.com> wrote

Quote:
How can I import text data from IBM DBI file with leading zeros? Once
this
data is imported into SQL, datatype will not convert from char to money,
maybe because of the hyphen that represents a negative number.

example of data:

Payment remit date patient name
000000-1247 09/08/03 Jane Doe
0000001247 09/08/03 Jane Doe

I need to delete the zeros in the DTS process so that it looks like this:

Payment remit date patient name
($12.47) 09/08/03 Jane Doe
$12.47 09/08/03 Jane Doe

Can anyone help me with this problem?



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.