To use tMSSqlLastInsertId correctly, you must disable "Use Batch Size" in the tMSSqlOutput component that does the insert. Otherwise, the last_insert_id value will always be zero.
NOTE: All kudos for this goes to Carl Bekwam Bekwam Blog: tMSSqlLastInsertId Returns 0. I added here because I didn't see it and felt it was helpful for the community.
Thanks for sharing it on forum.
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Watch the recorded webinar!
Find out about Talend's 2019 Summer release
Talend continues to revolutionize how businesses leverage speed and manage scale
Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend