Summary: checksum is pretty damn accurate (not 100%, but pretty close).
DECLARE @value1a VARCHAR(36)
DECLARE @value2a VARCHAR(36)
DECLARE @value1b VARCHAR(36)
DECLARE @value2b VARCHAR(36)
DECLARE @attempt bigint
SET @attempt = 0
SET @value1a = NEWID()
SET @value2a = NEWID()
SET @value1b = NEWID()
SET @value2b = NEWID()
WHILE checksum(@value1a, @value2a) <> checksum(@value1b, @value2b)
BEGIN
SET @attempt = @attempt + 1
SET @value1a = NEWID()
SET @value2a = NEWID()
SET @value1b = NEWID()
SET @value2b = NEWID()
IF @attempt%100000 = 0 PRINT @attempt
END
SELECT @attempt
SELECT @value1a value1a, @value2a value2a, checksum(@value1a, @value2a) chk_a
SELECT @value1b value2a, @value2b value2b, checksum(@value1b, @value2b) chk_b
No comments:
Post a Comment