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を追加するだけで、どうすればそれを取得できますか。