Programming Examples

Are you a Programmer or Application Developer or a DBA? Take a cup of coffee, sit back and spend few minutes here :)

Tag Archive for ‘Executing Remove term: Scalar-Valued Function Scalar-Valued Function’

SQL Scalar-Valued Function Explained

SQL Scalar-Valued function with Parameter

Stored Procedure and function in SQL server are the compiled unit of SQL Program which performs a specific task. Unlike a stored procedure, a User-Defined Function in SQL server can take part in the SQL Select Queries. In this example, we will try to create and use the Scalar-Valued Function in the SQL Server. A Scalar-Valued function returns a single value to its caller.

We create the Examples in this article using Microsoft supplied Titles table of Pubs database. You can download the SQL Script that creates the Pubs and NorthWnd database from the SQL 2005 Section of this site. Before we begin, here is the content of the Titles table that we can refer while going through the article:

Continue Reading →