dbTalk Databases Forums  

Removing Character

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


Discuss Removing Character in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gael Le Mouhaer
 
Posts: n/a

Default Removing Character - 06-17-2005 , 03:18 AM






Hello,
I have a DTS package that import AS400 data to SQL Server.
I have to transform some data.
So I have data like 20053453 that I need to transform to 2053453.
How can I remove the second character ?

Thanks for your help.

Gael

Reply With Quote
  #2  
Old   
Francesco Anti
 
Posts: n/a

Default Re: Removing Character - 06-17-2005 , 08:22 AM






You can transform the number in a string and then use
- SUBTRING function (in the select statement for example)
- or use an ActiveX transformation script. For example, in VBscript,
something similar to
left(cstr(DTSSource("YourField")),1) &
mid(cstr(DTSSource("YourField")),3,len(cstr(DTSSou rce("YourField"))-3))

Francesco Anti

"Gael Le Mouhaer" <gael.lemouhaer (AT) linum (DOT) fr> wrote

Quote:
Hello,
I have a DTS package that import AS400 data to SQL Server.
I have to transform some data.
So I have data like 20053453 that I need to transform to 2053453.
How can I remove the second character ?

Thanks for your help.

Gael



Reply With Quote
  #3  
Old   
Gael Le Mouhaer
 
Posts: n/a

Default Re: Removing Character - 06-17-2005 , 09:19 AM



"Francesco Anti" <fanti_ (AT) _sicosbt (DOT) it> écrivait news:OUp2s#zcFHA.3504
@TK2MSFTNGP12.phx.gbl:

Quote:
left(cstr(DTSSource("YourField")),1) &
mid(cstr(DTSSource("YourField")),3,len(cstr(DTSSou rce("YourField"))-3))
It works.

Thanks


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.