﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 7,2000 / T-SQL  / CHECKSUM / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 23 May 2013 23:59:17 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: CHECKSUM</title><link>http://www.sqlservercentral.com/Forums/Topic783416-8-1.aspx</link><description>[quote][b]Marcin Gol [SQL Server MVP] (9/7/2009)[/b][hr]maybe other question is right here ... does the implemantion of checksum function has changed over the time ? (sql 2000 -&gt; 2008?); if don't why im getting other values of checksum than Zahran ?[/quote]I get the same return values on SQL Server 2008.</description><pubDate>Tue, 08 Sep 2009 02:58:26 GMT</pubDate><dc:creator>Florian Reischl</dc:creator></item><item><title>RE: CHECKSUM</title><link>http://www.sqlservercentral.com/Forums/Topic783416-8-1.aspx</link><description>[quote][b]Marcin Gol [SQL Server MVP] (9/7/2009)[/b][hr][quote][b]Sergiy (9/7/2009)[/b][hr][quote][b]Marcin Gol [SQL Server MVP] (9/7/2009)[/b][hr]Sergiy - the paragraph you mentioned change nothing. hash is a hash - and for a given string should always return the same value. did you try to run his query on your sql ?[/quote]You probably did not reach the last sentence of the paragraph.;-)[/quote]i read it but i feel that we don't understand each other ;-)my version: for a given string we should always receive same hash, did i say that hash is unique? nope.maybe other question is right here ... does the implemantion of checksum function has changed over the time ? (sql 2000 -&gt; 2008?); if don't why im getting other values of checksum than Zahran ?[/quote]It actually returns the same hash value for unchanged original value.Is it any different on you machine?And the topic was actually about uniqueness problem. My reference was about it.</description><pubDate>Mon, 07 Sep 2009 16:19:02 GMT</pubDate><dc:creator>Sergiy</dc:creator></item><item><title>RE: CHECKSUM</title><link>http://www.sqlservercentral.com/Forums/Topic783416-8-1.aspx</link><description>[quote][b]Sergiy (9/7/2009)[/b][hr][quote][b]Marcin Gol [SQL Server MVP] (9/7/2009)[/b][hr]Sergiy - the paragraph you mentioned change nothing. hash is a hash - and for a given string should always return the same value. did you try to run his query on your sql ?[/quote]You probably did not reach the last sentence of the paragraph.;-)[/quote]i read it but i feel that we don't understand each other ;-)my version: for a given string we should always receive same hash, did i say that hash is unique? nope.maybe other question is right here ... does the implemantion of checksum function has changed over the time ? (sql 2000 -&gt; 2008?); if don't why im getting other values of checksum than Zahran ?</description><pubDate>Mon, 07 Sep 2009 16:09:22 GMT</pubDate><dc:creator>Marcin Gol</dc:creator></item><item><title>RE: CHECKSUM</title><link>http://www.sqlservercentral.com/Forums/Topic783416-8-1.aspx</link><description>Hi ZahranLittle quote from BOL[quote]When an MD5 hash algorithm is specified, the probability of HashBytes returning the same result for two different inputs is much lower than that of CHECKSUM.[/quote]Keep in mind. A hash is as unique as possible, but it's not a guarantee for [b]real[/b] uniqueness. If you have a VARCHAR(100) column it represents much more possible values than an INT.You can use HASHBYTES or BINARY_CHECKSUM to get a better hash than old CHECKSUM function.[code]SELECT    HASHBYTES('MD5', CustomerNo + Address)   ,BINARY_CHECKSUM(CustomerNo, Address)   ,CHECKSUM(CustomerNo, Address)FROM @checksum[/code]Anyway, a hash will never be a 100% guarantee for uniqueness. If you need unique values use an IDENTITY column or a GUID.GreetsFlo[i]Edit: Dang! Sorry, didn't notice this is the 2000 forum. Probably the new functions are not available...[/i]</description><pubDate>Mon, 07 Sep 2009 15:37:30 GMT</pubDate><dc:creator>Florian Reischl</dc:creator></item><item><title>RE: CHECKSUM</title><link>http://www.sqlservercentral.com/Forums/Topic783416-8-1.aspx</link><description>[quote][b]Marcin Gol [SQL Server MVP] (9/7/2009)[/b][hr]Sergiy - the paragrah you mentioned change nothing. hash is a hash - and for a given string should always return the same value. did you try to run his query on your sql ?[/quote]You probably did not reach the last sentence of the paragraph.;-)</description><pubDate>Mon, 07 Sep 2009 15:19:25 GMT</pubDate><dc:creator>Sergiy</dc:creator></item><item><title>RE: CHECKSUM</title><link>http://www.sqlservercentral.com/Forums/Topic783416-8-1.aspx</link><description>Sergiy - the paragrah you mentioned change nothing. hash is a hash - and for a given string should always return the same value. did you try to run his query on your sql ?</description><pubDate>Mon, 07 Sep 2009 10:51:26 GMT</pubDate><dc:creator>Marcin Gol</dc:creator></item><item><title>RE: CHECKSUM</title><link>http://www.sqlservercentral.com/Forums/Topic783416-8-1.aspx</link><description>[quote]which version of SQL Server 2000 you are running ? SP4? later ?[/quote]It's RTM version.</description><pubDate>Mon, 07 Sep 2009 00:51:44 GMT</pubDate><dc:creator>Zahran</dc:creator></item><item><title>RE: CHECKSUM</title><link>http://www.sqlservercentral.com/Forums/Topic783416-8-1.aspx</link><description>[quote]which version of SQL Server 2000 you are running ? SP4? later ?[/quote]It's RTM version.</description><pubDate>Mon, 07 Sep 2009 00:48:44 GMT</pubDate><dc:creator>Zahran</dc:creator></item><item><title>RE: CHECKSUM</title><link>http://www.sqlservercentral.com/Forums/Topic783416-8-1.aspx</link><description>[quote]which version of SQL Server 2000 you are running ? SP4? later ?[/quote]It's RTM version.</description><pubDate>Mon, 07 Sep 2009 00:45:42 GMT</pubDate><dc:creator>Zahran</dc:creator></item><item><title>RE: CHECKSUM</title><link>http://www.sqlservercentral.com/Forums/Topic783416-8-1.aspx</link><description>Please open BOL on CHECKSUM and read 2nd paragraph of "Remarks".</description><pubDate>Sun, 06 Sep 2009 22:03:44 GMT</pubDate><dc:creator>Sergiy</dc:creator></item><item><title>RE: CHECKSUM</title><link>http://www.sqlservercentral.com/Forums/Topic783416-8-1.aspx</link><description>which version of SQL Server 2000 you are running ? SP4? later ?</description><pubDate>Sun, 06 Sep 2009 12:23:23 GMT</pubDate><dc:creator>Marcin Gol</dc:creator></item><item><title>CHECKSUM</title><link>http://www.sqlservercentral.com/Forums/Topic783416-8-1.aspx</link><description>When I execute below SQL statement in SQL server 2000, I get the same value of 128414903 for the CHECKSUM in two different rows with different data. Why is that?[code]DECLARE @checksum TABLE(	CustomerNo CHAR(17)	,Address CHAR(40))INSERT INTO @checksumSELECT '00000000014331462','A15 Block No.: 3' UNION ALLSELECT '00000000061051462','F23 Block No.: 5'SELECT CHECKSUM(CustomerNo,Address)FROM @checksum[/code]</description><pubDate>Sun, 06 Sep 2009 03:47:18 GMT</pubDate><dc:creator>Zahran</dc:creator></item></channel></rss>