Using Data Transformation Services, part 4: Using the DTS Designer Objects (continued-2) - Column Transformation Code: Step 1
(Page 7 of 10 )
What is needed is to place the concatenated Col001 and Col002 from source in Col001 of destination. The source column variable is DTS Source("Col001") and therefore a simple code like this should suffice.
DTSDestination("Col001")=DTSSource("Col002")+" "+DTSSource("Col001")
With this script added (typed-in) the screen should appear as shown here.

If you click on the button Parse, if the parsing passes the test you should see this:

Just because the parsing is OK does not mean that there will be processing errors, since the provider should be able handle the code. Now click on the button Test.... Now the task is executed, but the result goes into a temporary table and will not apply the changes to your original configuration.

The Package Execution Results came from the Main function since the package executed without errors. Clicking away the message box brings the Testing Transformation to the front and you may view the result of this transformation in the following View Data screen as shown. You click on OK and then Done to return to the main screen.

So the transformation task has been accomplished. You may save the code for this transformation by clicking on the button Save. The script is saved to a *.bas file on your preferred location with a user supplied name.
Close the windows to return to the Transformation Data Task Properties window which should show the mappings you just carried out as shown. If you want you may test the transformation again. Also you are at liberty to edit or even delete the transformation.

Next: Column Transformation Code: Step 2 >>
More MS SQL Server Articles
More By Jayaram Krishnaswamy