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 7418549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:54:29+00:00 2026-05-29T07:54:29+00:00

I am integrating between 4 data sources: InternalDeviceRepository ExternalDeviceRepository NightlyDeviceDeltas MidDayDeviceDeltas Changes flow into

  • 0

I am integrating between 4 data sources:

InternalDeviceRepository
ExternalDeviceRepository
NightlyDeviceDeltas
MidDayDeviceDeltas

Changes flow into the InternalDeviceRepository from the other three sources.
All sources eventually are transformed to have the definition of

FIELDS
=============
IdentityField
Contract
ContractLevel
StartDate
EndDate
ContractStatus
Location

IdentityField is the PrimaryKey, Contract Key is a secondary Key only if a match exists, otherwise a new record needs to be created.

Currently I compare all the fields in a WHERE clause in SQL Statements and also in a number of places in SSIS packages. This creates some unclean looking SQL and SSIS packages.

I’ve been mulling computing a hash of ContractLevel, StartDate, EndDate, ContractStatus, and Location and adding that to each of the input tables. This would allow me to use a single value for comparison, instead of 5 separate ones each time.

I’ve never done this before, nor have I seen it done. Is there a reason that it should be used, or is that a cleaner way to do it?

  • 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-05-29T07:54:30+00:00Added an answer on May 29, 2026 at 7:54 am

    It is a valid approach. Consider to introduce a calculated field with the hash and index on it.

    You may use either CHECKSUM function or write your own hash function like this:

    CREATE FUNCTION dbo.GetMyLongHash(@data VARBINARY(MAX))
    RETURNS VARBINARY(MAX)
    WITH RETURNS NULL ON NULL INPUT
    AS
    BEGIN
        DECLARE @res VARBINARY(MAX) = 0x
        DECLARE @position INT = 1, @len INT = DATALENGTH(@data)
    
        WHILE 1 = 1
        BEGIN
            SET @res = @res + HASHBYTES('MD5', SUBSTRING(@data, @position, 8000))
            SET @position = @position+8000
            IF @Position > @len 
              BREAK
        END
        WHILE DATALENGTH(@res) > 16 SET @res= dbo.GetMyLongHash(@res)
        RETURN @res
    END
    

    which will give you 16-byte value – you may take all the 16 bytes as Guid, or only first 8-bytes as bigint and compare it.

    Adapt the function in your way – to accept string as parameter or even all the your fields instead of varbinary

    BUT

    • be careful with strings casing, datetime formats
    • if using CHECKSUM – check also other fields, checksum produces dublicates
    • avoid using 4-byte hash result on relaively big table
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am integrating data between two systems using Apache Camel. I want the resulting
I am integrating growl into my Objective-C app. However If I build and run
I'm working on integrating an HTML template slice into a SiteFinity theme and am
I'm looking at integrating an ESB into an existing Java/Maven web based product. Specifically,
What are the relations between NoSql and Data-Warehouse technologies/theories? What concepts they share? What
I have an XML file containing seed data that I'm trying to load into
I am wanting to transfer objects (tables, stored procedures, data etc) between two servers
We are working with large amounts of data, all tagged in UTC (in Java).
Fastest way to interface between live (unsaved) Excel data and C# objects features a
We are working on integrating two different applications that run simultaneously and share data.

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.