WHAT IS A FUNCTION IN SQL SERVER?
SQL CREATE FUNCTION:
SQl function Syntax:
- Schema_name is the name of the schema that owns the function.
- Function_name is the name to assign to this function in SQL Server.
- @parameter is one or more parameters passed into the function.
- type_schema_name is the schema that owns the data type, if applicable.
- Data type is the data type for @parameter.
- Default is a default value to assign to @parameter.
- READONLY means that @parameter cannot be overwritten by the function.
- return_datatype is the datatype of the function's return value.
- ENCRYPTION means that the source for the function will not be stored as plain text in the system views in SQL Server.
- SCHEMABINDING means that the underlying objects cannot be modified so as to affect the function.
- RETURNS NULL ON NULL INPUT means that the function will return NULL if any parameters are NULL without having to execute the function.
- CALL ON NULL INPUT means that the function will execute the function even if any parameters are NULL.
- EXECUTE AS clause sets the security context to execute the function.
- return_value is the value returned by the function.
SQL Function Example:
How to use SQL Function:
Sql Server Interview Qus:
- SQL Parameter how to use in asp.net
- SQL-QUERY TYPES, ALIASES, JOINS, CLAUSES, FUNCTIONS
- Sql-determine the version and edition of SQL Server
Predefined SQL Database FUNCTIONS:
- COUNT Function Return the count of an expression
- SUM Function Return the sum of an expression
- MIN Function Return the min of an expression
- MAX Function Return the max of an expression
- AVG Function Return the average of an expression