Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server Integration Services - Incremental data load hash comparison

Using SQL Server Integration Services (SSIS) to perform incremental data load, comparing a hash of to-be-imported and existing row data. I am using this:

http://ssismhash.codeplex.com/

to create the SHA512 hash for comparison. When trying to compare data import hash and existing hash from database using a Conditional Split task (expression is NEW_HASH == OLD_HASH) I get the following error upon entering the expression:

The data type "DT_BYTES" cannot be used with binary operator "==". The type of one or both of the operands is not supported for the operation. To perform this operation, one or both operands need to be explicitly cast with a cast operator.

Attempts at casting each column to a string (DT_WSTR, 64) before comparison have resulted in a truncation error.

Is there a better way to do this, or am I missing some small detail?

Thanks

like image 673
Bryan Avatar asked Apr 09 '26 14:04

Bryan


1 Answers

Have you tried expanding the length beyond 64? I believe DT_BYTES is valid up to 8000 characters. I verified the following are legal cast destinations for DT_BYTES based on the books online article:

  1. DT_I4
  2. DT_UI4
  3. DT_I8
  4. DT_UI8
  5. DT_STR
  6. DT_WSTR
  7. DT_GUID
  8. DT_IMAGE

I also ran a test in BIDS and verified it had no problem comparing the values once I cast them to a sufficiently long data type.

like image 171
Registered User Avatar answered Apr 11 '26 05:04

Registered User