May 2006
Intermediate to advanced
536 pages
15h 13m
English
In the introduction, I mentioned that cursors have the potential to yield better performance than set-based code when the problem is inherently order based. In this section, I’ll show some examples. Where relevant, I’ll discuss query constructs that ANSI introduces to allow for "cleaner" code that performs well without the use of cursors. However, some of these ANSI constructs have not been implemented in SQL Server 2005.
In Inside T-SQL Querying, I discussed custom aggregates by describing problems that require you to aggregate data even though SQL Server doesn’t provide such aggregates as built-in functions–for example, product of elements, string concatenation, and so on. I described four classes of solutions ...