Getting MD5 Hash Of File in SSIS

Posted on 2010-01-04
Last Modified: 2012-05-08
I need to get the Hash of the files content. I know SSIS gets the checksum for every row in the file. But what I need to get is the Hash of the content of the file. So, when I insert a log of the file processed and can insert the FileName and its hash (content of the file).

This will help me when I re-run the package and this package read the same filename, I calculate the hash of the content and then I compare this hash vs. the one that storage in the log table, so if the hash is the same I wont process anything, but if the hash is different I will process the file.

Anyone has experience with this?

Thank you
Question by:visibleworld
    1 Comment
    LVL 96

    Accepted Solution

    I don't have a lot of experience with SSIS, and code, but here is the code that I use to calculate an MD5 hash for a password.

    Imports System.Text.Encoding
    Imports System.Security.Cryptography
    Public Class Md5Hash
        Public Function Compute(ByVal password As String) As String
            Dim providerHash As New MD5CryptoServiceProvider
            Dim plainBytes() As Byte = UTF8.GetBytes(password)
            Dim hashBytes() As Byte = providerHash.ComputeHash(plainBytes)
            Dim computedHash As String = BitConverter.ToString(hashBytes).Replace("-"c, String.Empty)
            Return computedHash
        End Function
    End Class

    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
    For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK ( for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now