T-SQL: Checksum

Please see my other Database Development articles.

Constructing a hashtable with recordsets

Often times when building complex queries, it becomes difficult linking different sets of data using relationships due to the relative differences which may exists in the data.
For example, let’s pretend we have two different sources of data which only share a “first name” field.
In this example, I’ll use two tables to mimic two different data sources that both contain a first name field.
First, I populate one table with the first name and gender values.
In the second table, I populate with the first name values.
In both tables, each one also has a field which a contains checksum values using the first name field which will be used to “link” those records which share identical first name values.

Here is the final resultset.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s