Thursday, March 4, 2010

Convert hexadecimal values stored in string to integer equivalent

There have been a few occasions which I have come across where its required to convert hexadecimal value stored in string value to integer. In such cases a simple cast or convert wont work.Even converting to intermediate varbinary will also return wrong value. To handle such cases I've written a UDF which I'm posting here