all groups > sql server dts > june 2007 >
You're in the

sql server dts

group:

DTS uploading


DTS uploading Tiffany
6/18/2007 1:43:00 AM
sql server dts: Hi

Wanted to upload a text file to SQL table. one of the columns has data like
below

MDD - Inquiry abt showroom / dealers
MPFW - Inq. about Product Features & Specification
MRPC - Request For Product Catalogue / Broucher

When transferring the data from the text file to SQL table, i want to select
only the prefix, ie MDD, MPFW, MRPC etc. How can i do it in the DTS package.

Thank you

Re: DTS uploading Allan Mitchell
6/18/2007 6:10:16 PM
Hello Tiffany,

So you want to capture the data that comes before the space.

In DTS you would do this using a Active Script transform

Function Main


dim arr


arr = SPLIT(DTSSource("Name of Column"), " ")


DTSDestination("Prefix part") = arr(0)



Main=DTSTransformStat_OK


End Function



--

Allan Mitchell
http://wiki.sqlis.com | http://www.sqlis.com | http://www.sqldts.com |
http://www.konesans.com

[quoted text, click to view]

AddThis Social Bookmark Button