SQL Server/T-SQL Tutorial/System Functions/fn varbintohexsubstring
Invoking the fn_varbintohexsubstring() Scalar Function
4>
5> SELECT
6> master.dbo.fn_varbintohexsubstring(1, 0x0123456789abcdef, 1, 2)
7> GO
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
----------------
0x0123
(1 rows affected)