Conclusion

User-defined functions can be embedded in queries, constraints, and computed columns. This capability allows you to enhance the functionality of your queries while still preserving a high level of readability and simplicity. SQL Server 2005 introduces .NET integration and the ability to create functions with CLR code. You can create both scalar and table-valued CLR UDFs. Remember to use CLR UDFs wisely, though. They are especially good for tasks that T-SQL is not built to cope with efficiently, including procedural logic, complex calculations, string manipulation, and so on. On the other hand, .NET code should not be the choice when the task mainly involves set-based data manipulation. T-SQL will typically be simpler and perform much ...

Get Inside Microsoft® SQL Server™ 2005 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.