Best Practices for SQL CLR Usage

Before we close this chapter, we’d like to summarize certain best practices for the appropriate use of SQL CLR programming.

The CLR integration in SQL Server 2012 is a powerful technology. In some cases, it allows you to do things you can’t do practically in T-SQL (such as apply complex computational logic in stored procedures or triggers), and in other cases, it allows you to do things you can’t do at all in T-SQL (such as create your own aggregate functions).

The fact remains, however, that set-based data selection and modification is much better handled by the declarative constructs in T-SQL than in the procedural constructs of .NET and the ADO.NET object model. SQL CLR functionality should be reserved for specific ...

Get Programming Microsoft® SQL Server® 2012 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.