Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8971149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:53:21+00:00 2026-06-15T17:53:21+00:00

Please have a look at the SQL below: create table ChecksumTest (id int not

  • 0

Please have a look at the SQL below:

 create table ChecksumTest (id int not null identity, string1 varchar(10), 
string2 varchar(10), string3 varchar(10), string4 varchar(10), checksumvalue int)

insert into ChecksumTest (string1,string2,string3,string4) values ('Ian', 'Marie', 'Sharon', 'Mark')
insert into ChecksumTest (string1,string2,string3,string4) values ('Steven', 'Robert', 'Amy', 'Andy')
insert into ChecksumTest (string1,string2,string3,string4) values ('Sharon', 'Mark','Ian','Marie')

select distinct checksum1 ^ checksum2 As xor from (
select CHECKSUM(string1,string2) as checksum1, CHECKSUM(string3,string4) as checksum2
from ChecksumTest) As Checksums

The select statement returns two distinct XOR values because row one and row three in the table contain the same values. This is what I expect.

I have run the SELECT statement across about one million rows and the number of distinct XOR values is less than I thought. I realise that CHECKSUM is not always unique, but is it safe to use it like this when two different CHECKSUM strings (with multiple parameters e.g. CHECKSUM (String1, String2) can generate the same XOR value?

Is it safer to concatenate the strings together like this: CHECKSUM (String1 + String2) or perhaps a binary CHECKSUM?

Update
Every combination of four values contains two rows:
Row1: String1, String2, String3,String4
Row 2: String3,String4,String1,Strin2

I only want to return one row for each combination.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:53:23+00:00Added an answer on June 15, 2026 at 5:53 pm

    My solution was found here: How to do bitwise exclusive OR in sql server between two binary types?. It involved splitting every 8 bytes into binary(8).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please have a look at the schema below: CREATE TABLE Person (id int not
Please have a look at the below SQL code. DECLARE @RET TABLE(OID BIGINT NOT
Please have a look at the code below: import string from collections import defaultdict
Please have a look on the code below .. <div id=click_me>Save</div> <div id=blocks_sortable> <div
I have the following SQL statement which returns Not unique table/alias . I'm fairly
Please have a look at the code below. Dim results As IEnumerable(Of Customer) =
please have a look at the following code import java.util.ArrayList; import java.util.List; public class
Please have a look at the following code namespace Funny { class QuesionsAndAnswers {
Please have a look at the following code: $(#saveButton).click(function(){ $this = $(#tableData).find(input:checked).parent().parent(); tea =
Please have a look at the following machine code ‎0111001101110100011100100110010101110011011100110110010101100100 This means something. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.