Script in SSIS -
02-27-2006
, 03:32 AM
Hello
I have a package in DTS (SQL 2000) where I have the following ActiveX
script
Function Main()
Dim oPck, oTsk, oCn
Dim sSQL, rs
Dim sFullLoad
Set oPck = DTSGlobalVariables.Parent
'***************** GET THE PACKAGE SETTINGS FROM
CMDWHSERVER.UDW..UDW_Settings Table *****************
sSQL = "SELECT * FROM RealBI_Settings WHERE Application = 'TEST'"
Set rs = CreateObject("ADODB.Recordset")
rs.Open sSQL, "Provider=SQLOLEDB;Server=" + CStr(sSettingsServer) +
";Database=RealBI_Settings_Loggings;User ID
=;Password=;Trusted_Connection=yes"
If Not rs.EOF Then
sFullLoad = Trim(rs.Fields("Full_Load").Value)
rs.Close
Set rs = Nothing
'***************** START replace strings in SQL-Tasks / DataPump-Tasks
*****************
For Each oTsk In oPck.Tasks
If Left(oTsk.Description, 15) = "Check_Full_Load" Then '*** SQL-Task
***
sSQL = oTsk.CustomTask.SQLStatement
sSQL = Replace(sSQL, "<<FullLoad>>", sFullLoad, 1, -1,
vbTextCompare)
oTsk.CustomTask.SQLStatement = sSQL
End If
Next
'***************** END replace strings in SQL-Tasks / DataPump-Tasks
*****************
Set oTsk = Nothing
Set rs = Nothing
Set oPck = Nothing
End Function
So in each transform data task where the string <<FullLoad>> exists ,
it is replaced with the value of the column full_load in the
RealBI_Settings table
Is there a way in SSIS (SQL 2005) to do the same
Thx |