I would really like to use HashBytes directly but according to
http://msdn.microsoft.com/en-us/library/ms174415.aspx, it is limited to 8000 characters and I have much more than this!
>Take a look at this thread
http://www.tek-tips.com/viewthread.cfm?qid=1268144>
>In SQL Server you can use HashBytes function directly.
>
>>Hi
>>
>>I need to calculate the MD5 on SQL Server 2005 32-bits (no way for us to upgrade to 64-bits). I do it in a VB.Net method with which I have created an assembly in SQL server (so that I can use my method like a SQL UDF).
>>
>>It works great for small data but when I have a large object, I get one of those error:
>>
>>Msg 6535, Level 16, State 49, Line 1
>>.NET Framework execution was aborted. Another query caused the AppDomain DB_icISDev.dbo[runtime].101 to be unloaded or an unhandled .NET exception happened.
>>System.Threading.ThreadAbortException: Thread was being aborted.
>>System.Threading.ThreadAbortException:
>> at SqlServerProject1.UserDefinedFunctions.TestComputeMD5FromID(Int32 pID)
>>
>>or
>>
>>Msg 6532, Level 16, State 49, Line 1
>>.NET Framework execution was aborted by escalation policy because of out of memory.
>>System.Threading.ThreadAbortException: Thread was being aborted.
>>System.Threading.ThreadAbortException:
>> at System.Data.SqlTypes.SqlBytes.get_Value()
>> at System.Data.SqlServer.Internal.XvarBlobStream.GetByteArray()
>> at System.Data.SqlServer.Internal.XvarBlobStream.GetSqlBinary()
>>
>>
>>Any solutions/workaround?
>>
>>BTW, the same mehtod works correctly and with the same large object when not called from SQL Server.
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com