0

I am calculating checksum in a stored procedure :

CHECKSUM_AGG(checksum(cid,tableid, sid, pid, vid, Tablename, ColumnKey, ColumnValue))  from #FDATA 

But when @FDATA has these data:

1052 2 100 100008 VIS0 form.PAN_ELIG 4401001 1

1052 2 100 100008 VIS0 form.PAN_ELIG 4401002 1

1052 2 100 100008 VIS0 form.PAN_ELIG 4401004 0

1052 2 100 100008 VIS0 form.PAN_ELIG 4401005 0

1052 2 100 100008 VIS0 form.PAN_ELIG NULL NULL

1052 2 100 100008 VIS0 form.PAN_ELIG NULL NULL

The result is 512. Is that a valid checksum?

Because when @FDATA has data like:

1064 2 100 100002 VIS1 form.AGG_DEMOG 4502001 agge

1064 2 100 100002 VIS1 form.AGG_DEMOG 4502003 0

1064 2 100 100002 VIS1 form.AGG_DEMOG 4502006 0

The result is always something like this: -785679630

aggicd
  • 727
  • 6
  • 28
  • Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. – Enigmativity Jul 28 '17 at 10:20
  • Any value that fits in an `INT` is a valid checksum. And what does this have to do with C#? – Jeroen Mostert Jul 28 '17 at 10:22
  • @JeroenMostert nothing to do... my mistake because my code is in C# but the checksum is calculated in stored procedure – aggicd Jul 28 '17 at 10:24

0 Answers0