A scalar function returns exactly one value, unlike a 'table function' which returns a ... table.
This is our template for the scalar function. We (www.4Penny.net) are professional consultants and work at customers across the country. It's convenient to have these templates on the internet to be able to easily access them and get to coding.
"Doesn't SSMS have templates?" you ask. Of course it does. But ours are better, cleaner, quicker. Easier to access.