HashBytes Nvarchar(MAX)

  • SimonH

    SSCarpal Tunnel

    Points: 4214

    Comments posted to this topic are about the item HashBytes Nvarchar(MAX)

  • akljfhnlaflkj

    SSC Guru

    Points: 76202

    Thanks for the script

  • j-1064772

    SSCertifiable

    Points: 5316

    I suppose it is great for someone who knows what this is all about.

    This article stands out as the driest of them all, without any introduction or explanation of what this is all about.

    Not being at your level, I have learned nothing from just staring at code.

  • SimonH

    SSCarpal Tunnel

    Points: 4214

    Hi, their is a Header with explanation , I just placed it in the wrong place as it's my first function.

    If you click on my name or the title you will be able to see the explanation.

    However I suppose I could have still given a little more detail.

    Regards,

    Simon

  • j-1064772

    SSCertifiable

    Points: 5316

    Though a bit rude, my comment was actually intended to prompt (invite ?) a clarification because I am interested in what appeared to be a somewhat arcane topic I never had to use during the years I have been writing T-SQL (as shown as by rating - higher than "newcomer").

    I have followed your link and I found this:

    SQL SERVER Includes a Hashbytes function, however it's limited to VARCHAR(8000). This can cause a problem when trying to build hashes over wide datasets. Solution Expose the C# Hashbytes function using CLR Read more...

    This is still way above my level. I'll leave it up to you to decided if you want to expose at high technical level or to use the occasion to develop a mini-tutorial to introduce the uninitiated to a higher level. Something like why it is needed for instance, how to install it, how to use it, ...

    Regards

  • SimonH

    SSCarpal Tunnel

    Points: 4214

    Hi Please refer to this Stairway for a more in depth look at CLR.

    http://www.sqlservercentral.com/stairway/105855/.

    The Hashbytes function is used to proved a method of detecting changes over

    a row by generating a unique identifier against the underlying data and is documented on books online.

    However the SQL Server Version is limited to and input of varchar(8000).

    Heres an article showing the uses of Hashbytes in an incremental load senario.

    https://www.mssqltips.com/sqlservertip/3170/using-hash-values-in-ssis-to-determine-when-to-insert-or-update-rows/

    The method in this article uses an SSIS script to expose C# Cryptography Class.

    I just extended it to create the function using CLR.

    Regards,

    Simon

  • j-1064772

    SSCertifiable

    Points: 5316

    Thank you for the starting point. Now I should be able to raise my level of knowledge (one of the raison d'être of the forum).

    Regards

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply