Conclusion

As you probably realized from this chapter, TOP and APPLY are two features that in many ways complement each other. TOP with its new capabilities now allows expressions as input and is supported with modification statements. The new TOP functionality replaces the older SET ROWCOUNT option. The new APPLY operator allows for very simple and fast queries, compared to the previous alternatives, whenever you need to apply a table expression to each row of an outer query.

Get Inside Microsoft® SQL Server™ 2005: T-SQL Querying now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.