﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / SQL Server 2005 Integration Services  / How to map transformation using script task in SSIS? / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 18 Jun 2013 21:13:12 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: How to map transformation using script task in SSIS?</title><link>http://www.sqlservercentral.com/Forums/Topic429623-148-1.aspx</link><description>Please explain what you want to your package do. Sorry but it is difficult to analyze code ;).</description><pubDate>Wed, 05 Dec 2007 02:44:35 GMT</pubDate><dc:creator>Powichrowski Marek </dc:creator></item><item><title>RE: How to map transformation using script task in SSIS?</title><link>http://www.sqlservercentral.com/Forums/Topic429623-148-1.aspx</link><description>But how do i use for loop in here as for loops are not allowed in data flow task?</description><pubDate>Wed, 05 Dec 2007 02:25:26 GMT</pubDate><dc:creator>guptaopus</dc:creator></item><item><title>RE: How to map transformation using script task in SSIS?</title><link>http://www.sqlservercentral.com/Forums/Topic429623-148-1.aspx</link><description>May be to use conditional split component from source and on this basis add destinations for each condition?</description><pubDate>Wed, 05 Dec 2007 00:56:08 GMT</pubDate><dc:creator>Powichrowski Marek </dc:creator></item><item><title>How to map transformation using script task in SSIS?</title><link>http://www.sqlservercentral.com/Forums/Topic429623-148-1.aspx</link><description>Hi,I have a DTS package which is copying records from MS access database to SQL server database..they have mapped source and destination columns using ActiveX script which also has loop inside. I need to do same thing in SSIS...any body help me out please !!Below give is the sample code of that ActiveX  Script...please help me====================function Main(){	// If true, row fails.  Goes to false for each row	var bFailure = false;	// Contains value of condition string	var strValue ="";			// Only runs this routine once, and sets the conditions in the global variables for the remaining rows	if (DTSGlobalVariables("GotConditions") == false)	{		// Loop through all columns		for(var i=1;i&amp;lt; DTSSource.count;i++)		{			//Pass in field name to lookup for return of any conditions and store it in global var			strValue = DTSLookups("getConditions").Execute(DTSSource(i).Name);			DTSGlobalVariables(DTSSource(i).Name) = strValue;		}		// So this only happens once per import process		DTSGlobalVariables("GotConditions") = true;	}	// Loop through all columns	for(var i=1;i&amp;lt; DTSSource.count;i++)	{		// Global var is 0 if there are no conditions		if(!(DTSGlobalVariables(DTSSource(i).name)==0))		{			// Grab Condition(s) and eval them for true			// All conditions are OR'd with each other			var strCond = ""+DTSGlobalVariables(DTSSource(i).name)+"";			if(eval(strCond))			{				bFailure = true;			}		}	}		if(isNaN(DTSSource("MonFriOpenTime24"))){bFailure=true;}	if(isNaN(DTSSource("MonFriCloseTime24"))){bFailure=true;}	if(isNaN(DTSSource("SatOpenTime24"))){bFailure=true;}	if(isNaN(DTSSource("SatCloseTime24"))){bFailure=true;}	if(isNaN(DTSSource("SUN_O"))){bFailure=true;}	if(isNaN(DTSSource("SUN_C"))){bFailure=true;}	if (bFailure)	{		// Set the Changed field to 8, a failure or duplicate row		// so the import process knows not to transform it.		DTSDestination("Changed") = 8;		DTSDestination("InvalidDesc") = "Invalid Data" ;	}	DTSDestination("Post Date") = DTSSource("Post Date");	DTSDestination("Entity_ID_NK") = DTSSource("Entity ID");	DTSDestination("Division_ID_NK") = DTSSource("Division ID");	DTSDestination("DC_ID_NK") = DTSSource("DC ID");	DTSDestination("Store_No_nk") = DTSSource("Store no");	DTSDestination("DCID") = DTSSource("DCID");	DTSDestination("Division_Name") = DTSSource("Division Name");	DTSDestination("DC_Name") = DTSSource("DC Name");	DTSDestination("Store_Name") = DTSSource("STORE NAME");	DTSDestination("Business_Name") = DTSSource("Business Name");	DTSDestination("NAPA_Name") = DTSSource("NAPA NAME");	DTSDestination("Branch_Name") = DTSSource("Branch Name");	DTSDestination("Store_Type_Code") = DTSSource("Store Type Code");	DTSDestination("Store_Type_Name") = DTSSource("Store Type Name");}===============</description><pubDate>Tue, 04 Dec 2007 22:17:34 GMT</pubDate><dc:creator>guptaopus</dc:creator></item></channel></rss>