If you want to learn about using functions and a lot of other t-sql knowledge, I can't recommend Transact SQL User Defined Functions by Andrew Novick enough. Everything from design to formating. Before starting this book, you should have a basic understanding of sql. Probably one of the better programming books I've ever read.
You can get some help from tutorials such as ones available at Fianga and Function X.
Microsoft SQL Server is a computer
application used to create desktop,
enterprise, and web-based database
applications. It is used at different
levels and with various goals. This
web site provides lessons and topics
on how to use Microsoft SQL Server
2008 to create and manage databases.