SQL 16進位轉換 Hex Convert Int
SELECT BIBID,
SUBSTRING(BIBID, 1, 2) +
RIGHT(CONVERT(VARCHAR(8) ,CONVERT(varbinary(4), CONVERT(INT, CONVERT(VARBINARY, '00000' + SUBSTRING(BIBID, 3, 1), 2)) + 1), 2), 1) +
RIGHT(BIBID, LEN(BIBID) - 3),
RIGHT(CONVERT(VARCHAR(8) ,CONVERT(varbinary(4), CONVERT(INT, CONVERT(VARBINARY, '00000' + SUBSTRING(BIBID, 3, 1), 2)) + 1), 2), 1),
SUBSTRING(BIBID, 3, 1)
FROM [dbo].[BIBMasterActivityBin]
SUBSTRING(BIBID, 1, 2) +
RIGHT(CONVERT(VARCHAR(8) ,CONVERT(varbinary(4), CONVERT(INT, CONVERT(VARBINARY, '00000' + SUBSTRING(BIBID, 3, 1), 2)) + 1), 2), 1) +
RIGHT(BIBID, LEN(BIBID) - 3),
RIGHT(CONVERT(VARCHAR(8) ,CONVERT(varbinary(4), CONVERT(INT, CONVERT(VARBINARY, '00000' + SUBSTRING(BIBID, 3, 1), 2)) + 1), 2), 1),
SUBSTRING(BIBID, 3, 1)
FROM [dbo].[BIBMasterActivityBin]
留言
張貼留言