Early in your career you learnt that loops are bad and that you should use set-based statements. However, there are situations when trying to processing all at once takes you into problems. In this session we will learn what these situations are and how we can address them by splitting up the work in batches. We will learn techniques for batching and pitfalls to watch out for so that we don’t introduce new performance issues.We will also look at batching from a different angle: problems that requires a loop for, say, a single customer, but where we can process all customers abreast for better performance.