Wednesday, February 5, 2020

Merge join unpredictable behaviors


Today while on SSIS package, found very strange behavior where I will keep seeing rows coming for update but nothing would update because there was nothing to update.

Also would see rows that exist in destination but Merge join will bring them for insert. Strange!

After hours of research, found if you have "Sort" defined in one source in SSIS and order by defined in other source inside SQL Server then you will see all kind of unexpected behaviors.

Sort operation in SSIS is caSE Sensitive and it will NOT work right if there is data source that already is sorted in sql server.

So in short:
1. Dont mix sources with "Sort" in SSIS and with "order by" defined in sql server.
2. Sort operation inside ssis is caSE sensitive.
3. Keep one of the order by kinds. Either all from sql server or just defined inside SSIS.


HTH



No comments: