Skip to content

Don't Bite Off More Than You Can Chew - Take it in Chunks

Photo of Bob Duffy
Hosted By
Bob D.
Don't Bite Off More Than You Can Chew - Take it in Chunks

Details

  • Online Session* Click link to join at 19:00

Any SQL programmer with some experience knows that loops are bad and that you should work with all data at once in set-based statements. However, you may have experienced situations where this strategy did not work out well and you ran into problems like out-growing the transaction log or blocking other users.

You can solve this by operating on the data in chunks. Implementing chunking is not that difficult, but there are still pitfalls you can run into. In this session, I will discuss in what situations you may want to use chunking. I will give some best practices for how to implement chunking for good performance and I will highlight some things you need keep in mind, for instance, recovering from interruptions.

I will also look at how you can use chunking for error handling: You want process many rows and you want the good rows to succeed even if some rows yield errors – something you cannot do in a single set-based statement.

About Erland Sommarskog - Erland Sommarskog SQL-Konsult AB

Erland Sommarskog is an independent consultant based in Stockholm. He has worked with SQL Server since 1991. He was first awarded SQL Server MVP in 2001, and he has been re-awarded every year since. His focus is on systems development with the SQL Server Database Engine and his passion is to help people to write better SQL Server applications.

Photo of SQL Ireland User Group group
SQL Ireland User Group
See more events