WITH CTE_TBL
AS (SELECT  CONVERT(VARBINARY(1), 255)  AS COL1
    ,       '0xFF'                      AS COL2
    ,       'FF'                        AS COL3
)
SELECT  COL1
,       COL2
,       COL3

,       CONVERT(VARCHAR(MAX), COL1, 1)                                          AS 'varbinary -> 0x 추가된 문자'
,       CONVERT(VARCHAR(MAX), COL1, 2)                                          AS 'varbinary -> 0x 제거된 문자'
,       CONVERT(VARBINARY(MAX), COL2, 1)                                        AS '0x 가 식(COL2)의 있을 때 -> varbinary'
,       CONVERT(VARBINARY(MAX), COL3, 2)                                        AS '0x 가 식(COL3)에 없을 때 -> varbinary'

,       CASE WHEN CONVERT(VARCHAR(MAX), COL1, 1) = COL2     THEN 1 ELSE 0 END   AS '0xFF = 0xFF'
,       CASE WHEN CONVERT(VARCHAR(MAX), COL1, 2) = COL3     THEN 1 ELSE 0 END   AS 'FF = FF'
,       CASE WHEN COL1 = CONVERT(VARBINARY(MAX), COL2, 1)   THEN 1 ELSE 0 END   AS '0xFF = 0xFF'
,       CASE WHEN COL1 = CONVERT(VARBINARY(MAX), COL3, 2)   THEN 1 ELSE 0 END   AS '0xFF = 0xFF'
FROM CTE_TBL;




COL1    COL2    COL3    varbinary -> 0x 추가된 문자   varbinary -> 0x 제거된 문자  0x 가 식(COL2)의 있을 때 -> varbinary
----    ----    ----    --------------------------- --------------------------  -------------------------------------
0xFF    0xFF    FF      0xFF                        FF                          0xFF


0x 가 식(COL3)에 없을 때 -> varbinary     0xFF = 0xFF FF = FF 0xFF = 0xFF 0xFF = 0xFF
-------------------------------------   ----------- ------- ----------- -----------
0xFF                                    1           1       1           1