Are UDFs Harmful to SQL Server Performance?
SQL Server 2000 introduced user-defined functions (UDFs), and they were immediately hailed as a great tool for encapsulating repetitive code, as well as allowing you to perform more complicated processing directly in an SQL expression. On its face, that claim is valid. You can certainly improve readability and maintainability with UDFs. But cleaner code will be cold comfort if your queries bog down and lock up your server.