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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:20:08+00:00 2026-05-31T06:20:08+00:00

I have a scenario where I need to check if rows in a target

  • 0

I have a scenario where I need to check if rows in a target database need updating from a source database. The source data is actually a view and data from that view gets pumped into a destination table. Because the source view collects/rolls-up/pivots data from several underlying tables we don’t really have a good way to change the schema to support change tracking, so my thought was to compute a hash of each row’s data and include that as part of the view. We can then compare the hash value in the destination table to see if there’s a difference and update accordingly.

I’m aware of the:

CHECKSUM
BINARY_CHECKSUM
HASHYBYTES

functions. Either CHECKSUM() or BINARY_CHECKSUM() seems to be the best option but I’m not sure how well it will perform over a view with 50 columns and a million+ rows. I’m also aware that the checksums/hashes generated may not be different even after an edit, but that’s tolerable in this case.

So the question: Is the hash/checksum approach a good way to do this and if so what’s the best function to use? Or is there another, better way entirely to approach the problem?

(Oh, running on SQL Server 2005 now but we’ll soon be moving to 2008R2, if that helps.)

  • 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-31T06:20:09+00:00Added an answer on May 31, 2026 at 6:20 am

    I don’t know that I would trust CHECKSUM actually. I’ve seen many cases where people documented that two different rows produced a collision. Do you just want to know that a row has changed (or doesn’t exist in the destination yet)? Have you discarded the possibility of using ROWVERSION? Are you potentially updating data in both places?

    Since you are moving to SQL Server 2008 R2 soon, have you thought about other methods that already exist, such as Change Tracking or Change Data Capture? (Comparison here.) There are also other ways to solve this problem that don’t involve caring which rows have changed, but this depends on your end goal. In an old system I worked with, we would push out primary data changes en masse into a separate schema, then play switcheroo when the data had arrived. Of course all the data was updated in the source, and it was ok for the destination to be minutes behind. But it prevented the hassle of figuring out deltas between the source and destination.

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

Sidebar

Related Questions

I have a scenario where I need to load properties from database or java
I have this scenario where I need data integrity in the physical database. For
I have a scenario where I need to search from many binary files (using
i have a scenario where i need to check for the node count in
I have a scenario where I need to check for 10,000 different specific names
I have this scenario. I have 10 checkboxes that need to be generated(this list
I have scenario where I need to host a web service (WCF) on Azure
I have one scenario where I need to select all files having aliencoders.numeric-digits like
I have a scenario where I need to do the following in a transaction:
I have a scenario where I need a desktop console app to communicate with

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.