Convert DTS Transformation script into SSIS

Posted on 2011-10-05
Last Modified: 2013-11-10

I am looking at VB script that looks like the following:

Is there a SSIS task that handles like that?
Dim cr_id, tohr, fromhr, record, WeightCalc
	record = DTSSource("record")
	if rtrim(mid(record, 129,12)) = "" then 
		record = mid(record, 1,128) + "000000000000" + mid(record, 141)
	end if
	if rtrim(mid(record,47,8)) = "" then  
		record = mid(record, 1,46) + "00000000" + mid(record, 55)
	end if
	If rtrim(mid(record,85,8)) = "" then 
		record = mid(record, 1,84) + "00000000" + mid(record, 93)
	end if 
	If rtrim(mid(record,97,8)) = "" then
		record = mid(record, 1,96) + "00000000" + mid(record, 105)
	end if

Open in new window

Question by:yechan
    LVL 21

    Assisted Solution

    Try using an ActiveX Script task.


    LVL 30

    Accepted Solution

    you can do all of these within Data Flow task with Derived Column Transform or with Script Component,
    if you could tell us sample input data rows and sample desired output and we will help you to implement it in SSIS
    LVL 1

    Author Comment

    Hi reza_rad,

    thanks for your input.  I think I am going to try to implement this with a "Script Component".  The sample code above is a small snapshot of a 15 page script.  Thank you.  HOpe it's ok if I split the points.  I have the feeling I will be quite a bit here for next week or so =)

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Introduction In my previous article ( I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
    For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
    Viewers will learn how the fundamental information of how to create a table.
    Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now