Some operations are difficult or even impossible to obtain with
an expression, or the operation could become too complex to
achieve. The alternative is to create a function that would take
care of performing the operation and supplying the result to the
table. Of course, as you may know already, a function is its own
object. This means that, after creating it, to use its result in
a table, you must call it. For example, you can create a
function that returns a value, then call that function and
assign its returned value to a column. You can create your own
function and use it, or you can use one of the built-in
functions of Transact-SQL. In order to involve a function with
your data entry, you must have one. You can create your own
function using the techniques we learned already. To make the
function easily accessible, you should create it as part of the
database that would use it. Here is an example: --
============================================= -- Author:
FunctionX -- Create date: Saturday 22 December 2