Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

create scalar function in sql server

CREATE FUNCTION [schema_name.]function_name (parameter_list)
RETURNS data_type AS
BEGIN
    statements
    RETURN value
END


----------------------------
CREATE FUNCTION sales.udfNetSale(
    @quantity INT,
    @list_price DEC(10,2),
    @discount DEC(4,2)
)
RETURNS DEC(10,2)
AS 
BEGIN
    RETURN @quantity * @list_price * (1 - @discount);
END;
 
PREVIOUS NEXT
Tagged: #create #scalar #function #sql #server
ADD COMMENT
Topic
Name
4+1 =