UDFs can be one of the worst things you can do in SQL Server. Read my Death by UDF chapter in the SQL Server MVP Deep Dives 2 book and/or download my SQL Saturday presentation by the same name here: http://www.sqlsaturday.com/viewsession.aspx?sat=122&sessionid=10200
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service