To day i will Show you how to Create User defined Function SQL Server and how to Use it. I've already shared how create Store Procedures and How to Get a Return Value From Store Procedures in SQL Server . Store Procedure ,User Define Function and User Define or User Created Views are Always Saved in the Data Base (MDF file). They are all Fast and Pre-Compiled which means we call these Functions or Store Procedures From Our business logic layer or (Simply from Coding ) where they are Directly Executed and thus which Saves time. Difference of time saving is noticible in enviorments where you have 25-30 tables and Each table has 1,000-50,000 rows, in these Situations we Feel the Difference between In-Line Queries and Pre-Compiled SQL Statements(Store Procedure ,User Define Function and User Define or Created Views etc).