Truncation effect on input longer than 8,000 bytes.
DECLARE @v varchar(max);
SET @v = REPLICATE ('A', 9000); -- Input longer than 8,000 bytes
SELECT HashBytes('SHA1', @v);
SET @v = REPLICATE ('A', 8000); -- Input exactly 8,000 bytes
SELECT HASHBYTES('SHA1', @v);
The output, shown below, is the same hash value twice. This indicates that the two strings that were actually hashed were exactly the same.
0xD2967D6425E56C18BA979EEFB4E0DBD1269D9BC9
0xD2967D6425E56C18BA979EEFB4E0DBD1269D9BC9