Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File identity with HASHBYTES

Status
Not open for further replies.

RRinTetons

IS-IT--Management
Jul 4, 2001
333
US
I need to create a hash key for a 12,000 - 16,000 character value. I then need to write that hash key out of the database to an external repository. At any time in the future our cyber-forensic folks could use the hash key to establish that the agreement text stored in the db is the same as it was when the customer bought the services.

The text is store in a NVARCHAR(MAX) column. I want to concat some other metadata and the text and pass it to a routine to create the key. When I first dug out HASHBYTES I thought I was in good shape. I worked fine on little 100 character test stringss. Now it seems like it won't work, or at least not easily. HASHBYTES returns a VARBINARY(8000). That doesn't seem to be big enough for the 16,000 characters I need to give it. I keep getting errors stating that I'm going to truncate data.

I can do some sort of a trick with segmenting the text data into several substrings and getting a hash key on each one of them, but that clumsy and could lead to confusion if I ever had to explain how it worked to a non-technical audience.

So, any other ideas?

-
Richard Ray
Jackson Hole Mountain Resort
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top