Script Component

Read Object variable inside SSIS Script Component


Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper

Public Class ScriptMain
Inherits UserComponent

Public Overrides Sub CreateNewOutputRows()
Dim olead As New Data.OleDb.OleDbDataAdapter
Dim dt As New Data.DataTable
Dim row As System.Data.DataRow

olead.Fill(dt, Me.Variables.ObjTradeFeedData)

For Each row In dt.Rows
With Output0Buffer
.AddRow()
.TradeID = row("TradeID").ToString
.BookName = row("TradeBook").ToString
.PortfolioID = row("TradePortfolioID").ToString
.IssuerSDSID = row("UnderlyingSDS").ToString
.CreditRiskCurveId = row("CreditRiskCurveId").ToString
.Currency = row("Currency").ToString
.ValuationDate = row("ValuationDate").ToString
End With
Next
End Sub
End Class

Tags: , ,

Friday, March 2nd, 2012 SSIS No Comments

Increment a Variable Value in SSIS ScriptComponent


Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper

Public Class ScriptMain
Inherits UserComponent
Dim Counter As Integer
Public Sub New()
Counter = 0
End Sub
Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
Counter += 1
Row.NewTenorID = Counter
End Sub
Public Overrides Sub PreExecute()
MyBase.PreExecute()
Counter = Variables.MaxTenorID
End Sub

End Class

Tags: , ,

Friday, March 2nd, 2012 SSIS No Comments