dbTalk Databases Forums  

Script in SSIS

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Script in SSIS in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
g4rc@telenet.be
 
Posts: n/a

Default 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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.