Hi ,
I am looking to convert all the source column to md5 hash value,
I never worked on this scenario.below is my code , please suggest me where and what i need to change in code to get md5 value in derived columnhashvalue of all incoming rows.
My script component code is :-
Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime
Imports System.Data.SqlClient
Imports System.Data.SqlClient.SqlConnection
Imports Microsoft.SqlServer.Dts.Pipeline
Imports System.Text
Imports System.Security.Cryptography
<Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute()> _
<CLSCompliant(False)> _
Public Class ScriptMain
Inherits UserComponent
Dim connMgr As IDTSConnectionManager100
Dim sqlConn As SqlConnection
Dim sqlCmd As SqlCommand
Dim sqlParam As SqlParameter
Private inputBuffer As PipelineBuffer
Public Overrides Sub AcquireConnections(ByVal Transaction As Object)
connMgr = Me.Connections.Connection
sqlConn = CType(connMgr.AcquireConnection(Nothing), SqlConnection)
End Sub
Public Overrides Sub PreExecute()
sqlCmd = New SqlCommand("SELECT * FROM TestEmpS", sqlConn)
'sqlParam = New SqlParameter("@filem", SqlDbType.VarChar)
'sqlCmd.Parameters.Add(sqlParam)
End Sub
Public Overrides Sub CustomerRecordsInput_ProcessInputRow(ByVal Row As CustomerRecordsInputBuffer)
Dim reader As SqlDataReader
' sqlCmd.Parameters("@KeyCustomer").Value = Row.CUNO
reader = sqlCmd.ExecuteReader()
If reader.Read() Then
'do all field comparisons here to determine if
' the record changed since the last ETL.
If (reader("Name").ToString() <> Row.Name) Then
' Row.DirectRowToUpdateRecordsOutput()
Row.DirectRowToInsertRecordsOutput()
ElseIf (reader("Name").ToString() = Row.Name) Then
Row.DirectRowToIgnoreRecordsOutput()
End If
Else
Row.DirectRowToInsertRecordsOutput()
End If
reader.Close()
' If sqlConn.State = ConnectionState.Open Then sqlConn.Close()
End Sub
Public Overrides Sub ReleaseConnections()
connMgr.ReleaseConnection(sqlConn)
End Sub
End Class
Thanks in advance.
Regards,
Vipin jha
Thankx & regards, Vipin jha MCP