{30D016F9-3734-4E33-A861-5E7D899E18F3};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}DebugAnyCPULibraryScriptComponent_946f5164af91439fadfea81b2e4f1106.vbprojScriptComponent_946f5164af91439fadfea81b2e4f1106.vbprojOnBinaryOffOn{6E1470A4-EA16-4B9B-9D11-906F9FA18E4E}truetruetruefalsebin\falsefalse42016,42017,42018,42019,42032,42353,42354,42355falsetruefalsetruebin\falsefalse42016,42017,42018,42019,42032,42353,42354,42355FalseC:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SqlServer.ManagedDTS\v4.0_11.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.ManagedDTS.dllCodeVbMyResourcesResXFileCodeGeneratorResources.Designer.vbMy.ResourcesTrueTrueResources.resxCodeSettingsSingleFileGeneratorSettings.Designer.vbTrueSettings.settingsCodeSSIS_SC110v4.0]]>
'The following GUID is for the ID of the typelib if this project is exposed to COM
' Version information for an assembly consists of the following four values:
'
' Major Version
' Minor Version
' Build Number
' Revision
'
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:
'
]]> _
Public Class UserComponent
Inherits ScriptComponentPlus
Public Connections As New Connections(Me)
Public Variables As New Variables(Me)
Public OutputBuffer As OutputBuffer
Dim InputsFinished As Integer = 0
Public Overrides Sub ProcessInput(ByVal InputID As Integer, ByVal InputName As String, ByVal Buffer As PipelineBuffer, ByVal OutputMap As OutputNameMap)
If InputID = MyBase.ComponentMetaData.InputCollection("Input").ID Then
Input_ProcessInput(New InputBuffer(Me, InputID, True, Buffer, OutputMap))
End If
If Buffer.EndOfRowset Then
InputsFinished = InputsFinished + 1
If InputsFinished = 0 Then
FinishOutputs()
MarkOutputsFinished()
End If
End If
End Sub
Public Overridable Sub FinishOutputs()
End Sub
Private Sub MarkOutputsFinished()
If OutputBuffer IsNot Nothing Then
OutputBuffer.SetEndOfRowset
OutputBuffer = Nothing
End If
End Sub
Public Overrides Sub PrimeOutput(ByVal Outputs As Integer, ByVal OutputIDs() As Integer, ByVal Buffers() As PipelineBuffer, ByVal OutputMap As OutputNameMap)
For I As Integer = 0 To Outputs - 1
If OutputIDs(I) = GetOutputID(OutputMap, "Output") Then
OutputBuffer = New OutputBuffer(Me, OutputIDs(I), False, Buffers(I), OutputMap)
End If
Next
CreateNewOutputRows()
End Sub
Public Overridable Sub CreateNewOutputRows()
End Sub
Public Overridable Sub Input_ProcessInput(ByVal Buffer As InputBuffer)
While Buffer.NextRow()
Input_ProcessInputRow(Buffer)
End While
End Sub
Public Overridable Sub Input_ProcessInputRow(ByVal Row As InputBuffer)
End Sub
End Class
Public Class Connections
Dim ParentComponent As ScriptComponent
_
Public Sub New(ByVal Component As ScriptComponent)
ParentComponent = Component
End Sub
End Class
Public Class Variables
Dim ParentComponent As ScriptComponent
_
Public Sub New(ByVal Component As ScriptComponent)
ParentComponent = Component
End Sub
End Class
]]> _
_
_
Public Class ScriptMain
Inherits UserComponent
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Overrides Sub ProcessInput( _
ByVal InputID As Integer, _
ByVal Buffer As Microsoft.SqlServer.Dts.Pipeline.PipelineBuffer)
While Buffer.NextRow()
Dim splitValue() As String = New String() {}
If Not Buffer.IsNull(m_splitIndex) Then
splitValue = Buffer.GetString(m_splitIndex).Split(m_splitChars)
End If
Dim splitCount As Integer = splitValue.Length
For splitItem As Integer = 0 To splitCount - 1
Call MyBase.OutputBuffer.AddRow()
For Each pair As DictionaryEntry In m_colsIndex
Dim iIndex As Integer = CInt(pair.Key)
Dim oIndex As Integer = CInt(pair.Value)
If iIndex <> m_splitIndex Then
Dim value As Object = Buffer(iIndex)
If TypeOf value Is BlobColumn Then
value = Buffer.GetString(iIndex)
End If
If value Is Nothing Then
Call MyBase.OutputBuffer.Buffer.SetNull(oIndex)
Else
MyBase.OutputBuffer.Buffer(oIndex) = value
End If
Else
' Set current split value.
MyBase.OutputBuffer.Buffer(oIndex) = splitValue(splitItem)
End If
Next
Next
End While
If Buffer.EndOfRowset Then
Call MyBase.OutputBuffer.SetEndOfRowset()
End If
End Sub ' ProcessInput
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Overrides Sub PreExecute()
Call MyBase.PreExecute()
Dim input As IDTSInput100 = MyBase.ComponentMetaData.InputCollection(0)
Dim output As IDTSOutput100 = MyBase.ComponentMetaData.OutputCollection(0)
' Find split column index.
m_splitIndex = MyBase.HostComponent.BufferManager.FindColumnByLineageID( _
input.Buffer, _
input.InputColumnCollection(Me.SplitColumn).LineageID)
' Get split chars.
m_splitChars = Regex.Unescape(Me.SplitSymbol).ToCharArray()
' Find columns index from input to output.
Dim colsCount As Integer = input.InputColumnCollection.Count
m_colsIndex = New Hashtable()
For colIndex As Integer = 0 To colsCount - 1
Dim inColumn As IDTSInputColumn100 = input.InputColumnCollection(colIndex)
Dim inIndex As Integer = MyBase.HostComponent.BufferManager.FindColumnByLineageID( _
input.Buffer, _
inColumn.LineageID)
Dim outIndex As Integer = MyBase.HostComponent.BufferManager.FindColumnByLineageID( _
output.Buffer, _
output.OutputColumnCollection(inColumn.Name).LineageID)
' Set input -> output column index.
m_colsIndex(inIndex) = outIndex
Next
End Sub ' PreExecute
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Function Validate(ByRef errMessage As String) As Boolean
Dim result As Boolean = True
Try
Dim input As IDTSInput100 = MyBase.ComponentMetaData.InputCollection(0)
Dim virtInput As IDTSVirtualInput100 = input.GetVirtualInput()
If virtInput.VirtualInputColumnCollection.Count > 0 AndAlso _
String.IsNullOrEmpty(Me.SplitColumn) Then
Throw New Exception("Select split column.")
ElseIf String.IsNullOrEmpty(Me.SplitSymbol) Then
Throw New Exception("Specify split symbol.")
End If
Catch ex As Exception
result = False
errMessage = ex.Message
End Try
Validate = result
End Function 'Validate
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Copy input columns to the asynchronous output.
Public Overrides Sub OnInputPathAttached(ByVal inputID As Integer)
Call MyBase.OnInputPathAttached(inputID)
Call MyBase.ComponentMetaData.InputCollection(0).InputColumnCollection.RemoveAll()
Call MyBase.ComponentMetaData.OutputCollection(0).OutputColumnCollection.RemoveAll()
Dim virtInput As IDTSVirtualInput100 = MyBase.ComponentMetaData.InputCollection.GetObjectByID(inputID).GetVirtualInput()
Dim outputCols As IDTSOutputColumnCollection100
outputCols = MyBase.ComponentMetaData.OutputCollection(0).OutputColumnCollection
Dim managedComponent As CManagedComponentWrapper = MyBase.ComponentMetaData.Instantiate()
Dim colsCount As Integer = virtInput.VirtualInputColumnCollection.Count
For colIndex As Integer = 0 To colsCount - 1
Dim inputCol As IDTSVirtualInputColumn100 = virtInput.VirtualInputColumnCollection(colIndex)
' Setup input column.
Call managedComponent.SetUsageType( _
inputID, _
virtInput, _
inputCol.LineageID, _
DTSUsageType.UT_READONLY)
' Add output column.
Dim outputCol As IDTSOutputColumn100 = outputCols.[New]()
outputCol.Name = inputCol.Name
With inputCol
Call outputCol.SetDataTypeProperties(.DataType, .Length, .Precision, .Scale, .CodePage)
End With
Next
End Sub ' OnInputPathAttached
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Overrides Sub OnInputPathDetached(ByVal inputID As Integer)
Call MyBase.OnInputPathDetached(inputID)
Call MyBase.ComponentMetaData.InputCollection(0).InputColumnCollection.RemoveAll()
Call MyBase.ComponentMetaData.OutputCollection(0).OutputColumnCollection.RemoveAll()
End Sub ' OnInputPathDetached
#Region "Properties"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
_
_
Public Property SplitColumn() As String
Get
SplitColumn = m_splitColumn
End Get
Set(ByVal value As String)
m_splitColumn = value
End Set
End Property ' SplitColumn
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
_
Public Property SplitSymbol() As String
Get
SplitSymbol = m_splitSymbol
End Get
Set(ByVal value As String)
m_splitSymbol = value
End Set
End Property ' SplitSymbol
#End Region ' Properties
#Region "Internals"
#End Region ' Internals
#Region "Attributes"
Private m_splitColumn As String
Private m_splitSymbol As String
Private m_splitIndex As Integer
Private m_splitChars() As Char
Private m_colsIndex As Hashtable
#End Region ' Attributes
End Class ' ScriptMain
]]> _
Public Class InputBuffer
Inherits ScriptBufferPlus
Public Sub New(ByVal Component As ScriptComponent, ByVal ObjectID As Integer, ByVal IsInput As Boolean, ByVal Buffer As PipelineBuffer, ByVal OutputMap As OutputNameMap)
MyBase.New(Component, ObjectID, IsInput, Buffer, OutputMap)
End Sub
Public Overrides ReadOnly Property StaticInputColumns() As String()
Get
Return New String() {}
End Get
End Property
Public Overrides ReadOnly Property StaticOutputColumns() As String()
Get
Return New String() {}
End Get
End Property
Public Overloads Function NextRow() As Boolean
NextRow = MyBase.NextRow()
End Function
Public Overloads Function EndOfRowset() As Boolean
EndOfRowset = MyBase.EndOfRowset
End Function
End Class
_
Public Class OutputBuffer
Inherits ScriptBufferPlus
Public Sub New(ByVal Component As ScriptComponent, ByVal ObjectID As Integer, ByVal IsInput As Boolean, ByVal Buffer As PipelineBuffer, ByVal OutputMap As OutputNameMap)
MyBase.New(Component, ObjectID, IsInput, Buffer, OutputMap)
End Sub
Public Overrides ReadOnly Property StaticInputColumns() As String()
Get
Return New String() {}
End Get
End Property
Public Overrides ReadOnly Property StaticOutputColumns() As String()
Get
Return New String() {}
End Get
End Property
Public Overloads Sub AddRow()
MyBase.AddRow()
End Sub
Public Overloads Sub SetEndOfRowset()
MyBase.SetEndOfRowset()
End Sub
Public Overloads Function EndOfRowset() As Boolean
EndOfRowset = MyBase.EndOfRowset
End Function
End Class
]]>]]>
' This code was generated by a tool.
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
'
'------------------------------------------------------------------------------
Option Strict Off
Option Explicit On
Partial Friend NotInheritable Class MySettings
Inherits System.Configuration.ApplicationSettingsBase
Private Shared m_Value As MySettings
Private Shared m_SyncObject As Object = New Object
_
Public Shared ReadOnly Property Value() As MySettings
Get
If (MySettings.m_Value Is Nothing) Then
System.Threading.Monitor.Enter(MySettings.m_SyncObject)
If (MySettings.m_Value Is Nothing) Then
Try
MySettings.m_Value = New MySettings
Finally
System.Threading.Monitor.Exit(MySettings.m_SyncObject)
End Try
End If
End If
Return MySettings.m_Value
End Get
End Property
End Class
]]>msBuildReference;Import;Folder{71DE4FA1-450C-44B2-9DF1-C897A1B81D8C}scriptcomponent_946f5164af91439fadfea81b2e4f1106scriptcomponent_946f5164af91439fadfea81b2e4f1106]]>text/microsoft-resx2.0System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]>
' This code was generated by a tool.
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
'
'------------------------------------------------------------------------------
Option Strict Off
Option Explicit On
Namespace My.Resources
'''
''' A strongly-typed resource class, for looking up localized strings, etc.
'''
'This class was auto-generated by the Strongly Typed Resource Builder
'class via a tool like ResGen or Visual Studio.NET.
'To add or remove a member, edit your .ResX file then rerun ResGen
'with the /str option, or rebuild your VS project.
Class MyResources
Private Shared _resMgr As System.Resources.ResourceManager
Private Shared _resCulture As System.Globalization.CultureInfo
Friend Sub New()
MyBase.New
End Sub
'''
''' Returns the cached ResourceManager instance used by this class.
''' _
Public Shared ReadOnly Property ResourceManager() As System.Resources.ResourceManager
Get
If (_resMgr Is Nothing) Then
Dim temp As System.Resources.ResourceManager = New System.Resources.ResourceManager("My.Resources.MyResources", GetType(MyResources).Assembly)
_resMgr = temp
End If
Return _resMgr
End Get
End Property
'''
''' Overrides the current thread's CurrentUICulture property for all
''' resource lookups using this strongly typed resource class.
''' _
Public Shared Property Culture() As System.Globalization.CultureInfo
Get
Return _resCulture
End Get
Set
_resCulture = value
End Set
End Property
End Class
End Namespace
]]>CozyRoc.SqlServer.SSIS.ScriptComponentHostPlus, CozyRoc.SSISPlus.2012, Version=1.0.0.0, Culture=neutral, PublicKeyToken=16cf490bb80c34eaScriptComponent_946f5164af91439fadfea81b2e4f1106VisualBasic