• When you CONVERT(VARBINARY, '0x8A')

    sql converts the chars to hex (0x30783841)

    30 (0) 78 (x) 38 (8) 41 (A)

    When you CONVERT(VARBINARY, 0x8A)

    sql converts the value 0x8A to hex (0x8A)

    That is why when these are converted to int one works the other does'nt.

    I think Franks dynamic sql solution is the only way unless you write a function to manually do the conversion.

    Far away is close at hand in the images of elsewhere.
    Anon.