Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
koese
Starting Member
1 Post |
Posted - 2011-05-30 : 00:17:31
|
Hi I have created the below UDF from SQl CLR database Project from Visiual Studio 2010and after diploying the UDF it works fine on the sql test Server Since my SQl Production server is a shared hosting server it does not support the .Net Framerwork CLR, It is disabled on the sql 2008 databaseCan some one help me to convert this function into a SQL standalone UDFPublic Shared Function ChecksumMTS(ByVal MerchantxnStem As String) As StringConst ReplaceChars As String = ("abcdef")Const ReplaceWith As String = ("JKLMPR")Dim sha_1 As New SHA1CryptoServiceProvider()Dim i As LongDim a As Byte() = Encoding.UTF8.GetBytes(MerchantxnStem)Dim t As String = Convert.ToBase64String(sha_1.ComputeHash(a))t = Mid(t, 2, 2)i = InStr(ReplaceChars, (Left(t, 1)))If i ThenMid(t, 1, 1) = Mid(ReplaceWith, i, 1)End Ifi = InStr(ReplaceChars, (Right(t, 1)))If i ThenMid(t, 2, 1) = Mid(ReplaceWith, i, 1)End IfChecksumMTS = tEnd FunctionThanks |
|
|
|
|
|
|