DECLARE @V AS VARBINARY(8)
SET @V = 0x000000003B654036;
SELECT @V as 'Before'
Set @V = @V+0x0000000000000001;
SELECT @V as 'After'
Before: 0x000000003B654036
After: 0x000000003B654036
Expanding the varbinary result to a larger value I see where the 0x0000000000000001 is going
DECLARE @V AS VARBINARY(8);
DECLARE @R AS VARBINARY(max);
SET @V = 0x000000003B654036;
SELECT @V as 'Before';
SET @R = @V +0x0000000000000001;
SELECT @R as 'After' ;
Before: 0x000000003B654036
After: 0x000000003B6540360000000000000001
但我正在寻找 0x000000003B65407 的结果,我如何通过将 1 添加到二进制值来获得它。