SQL Server Performance

CONVERT BINARY TO VARCHAR AND VIEW CODE HEX

Discussion in 'SQL Server 2005 General Developer Questions' started by MACUL, Dec 22, 2006.

  1. MACUL New Member

    I need convert field binary in character.
    But i like view this value of field the characters hex.

    example this value :
    0x3DD8F4A6D9C1
    I need :
    3DD8F4A6D9C1


    The convertion to varchar transform in characters asc
    select cast(0x3DD8F4A6D9C1 as varchar)
    result
    =Øô¦ÙÁ


    On the Books online show
    SELECT CAST(CAST(0x41 AS nvarchar) AS varbinary)

    create table test
    (
    field binary(16),
    field2 varchar(16)
    )

    insert into #test values(0x3D84F5E628837841B897D46D5A6F31D4, '')

    update #test
    set field2 = field



    www.macul.eti.br

    www.macul.hpg.com.br

    www.primeiramao.com.br
    (ad free)
  2. jezemine New Member

Share This Page