sys.fn_varbintohexstr function : sys.fn_varbintohexstr « System Tables Views « SQL Server / T-SQL Tutorial






4> DECLARE @sql AS NVARCHAR(4000),
5>   @b AS VARBINARY(1000), @s AS VARCHAR(2002);
6> SET @b = 0x0123456789ABCDEF;
7> SET @s = sys.fn_varbintohexstr(@b);
8> SELECT @s;
9> GO











--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--
0x0123456789abcdef








27.4.sys.fn_varbintohexstr
27.4.1.sys.fn_varbintohexstr function