Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Need Solution for ActiveX script in SSIS Expand / Collapse
Author
Message
Posted Friday, October 26, 2007 5:46 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, December 16, 2013 9:05 AM
Points: 116, Visits: 241
Hi,

I have activex script in my DTS package but i want to convert this into SSIS, I need to know which is the best solution in Script task,activex script task or using variables and control loops??? below given is my activex code please any body help me in finding solution

'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
FUNCTION Main()
Dim oPkg, oTaskProperties
Dim iTaskCount, iPropertyCount, iMaxPackageVersion
Dim strTaskFileName

' SET OBJECT TO CURRENT PACKAGE
SET oPkg = DTSGlobalVariables.Parent

' LOOP THROUGH ALL PACKAGE TASKS TO DETERMINE WHICH ARE "Execute Package Task" OBJECTS
FOR iTaskCount = 1 to oPkg.Tasks.Count
' IF PACKAGE IS "Execute Package Task" SET GUID
IF isExecutePackageTask(oPkg.Tasks(iTaskCount).Properties) THEN
' GET THE FILE PATH AND NAME FROM THE TASK
strTaskFileName = oPkg.Tasks(iTaskCount).Properties.Item("FileName")

' GET PACKAGE GUID FROM THE FILE LOCATION
SET oInfoCollection = oPkg.GetSavedPackageInfos(strTaskFileName)
' SET THE MAX VERSION ID TO GET THE GUID
iMaxPackageVersion = oInfoCollection.Count

' SET THE GUID
oPkg.Tasks(iTaskCount).Properties.Item("PackageID").Value = oInfoCollection.Item(iMaxPackageVersion).PackageID
END IF
NEXT

' CLEAN UP
SET oPkg = NOTHING
SET oInfoCollection = NOTHING

Main = DTSTaskExecResult_Success
END FUNCTION

'**********************************************************************
' FUNCTION:
' isExecutePackageTask
' ARGUMENTS:
' oTaskProperties - Local Task Properies
' RETURNS:
' (boolean)
' PURPOSE:
' Determine if a task is an "Execute Package" Task
'************************************************************************
FUNCTION isExecutePackageTask(oTaskProperties)
' LOCAL VARIABLES DECLARATION
DIM iPropertyLoop, RTN

' INITIALIZE RETURN VARIABLE
RTN = FALSE

' LOOP THROUGH TASK'S PROPERTIES. IF "PackageID" EXISTS IN THE
' PROPERTIES, THEN THE TASK IS AN "Execute Package" TASK
FOR iPropertyLoop = 1 TO oTaskProperties.Count
IF oTaskProperties(iPropertyLoop).Name = "PackageID" THEN
RTN = TRUE
EXIT FOR
END IF
NEXT

' RETURN
isExecutePackageTask = RTN
END FUNCTION


Post #415316
Posted Friday, October 26, 2007 6:02 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: Banned Members
Last Login: Sunday, September 7, 2014 11:11 PM
Points: 2,622, Visits: 328
I'm not sure whether this give us atleast 25% satisfication to which result set you have been aiming for.. but thought of send this link....

http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/Q_21803338.html
Post #415327
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse