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
varbinary <-> varchar 상호 변환
|
2012.10.29 11:10:31
|
2012.10.29 11:10:31
|
1421
|
Aiden
Total of Attached file
0.00 Bytes of 0 files
2018.06.11
2018.05.31
2018.01.12
2018.01.03
2017.10.23
2012.10.29
2012.10.19
2012.09.04
2012.09.01
2012.07.19
2012.07.18