A User-Defined Function (UDF) is a function defined by a user, allowing custom logic to be reused in the user environment. UDFs are usually written for the requirement of its user and are executed by the database software. UDFs can be scalar functions, inline table-valued functions, or multistatement table-valued functions. UDFs can be created in languages other than SQL, such as C#, C, or Java programming languages. UDFs can be used to extend or enhance SQL with functionality that SQL doesn’t have or doesn’t do well. UDFs can be scalar or tabular functions, and they can be written in any of several programming languages.