mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
40 lines
1.2 KiB
Transact-SQL
40 lines
1.2 KiB
Transact-SQL
-- ================================================
|
|
-- Template generated from Template Explorer using:
|
|
-- Create Multi-Statement Function (New Menu).SQL
|
|
--
|
|
-- Use the Specify Values for Template Parameters
|
|
-- command (Ctrl-Shift-M) to fill in the parameter
|
|
-- values below.
|
|
--
|
|
-- This block of comments will not be included in
|
|
-- the definition of the function.
|
|
-- ================================================
|
|
SET ANSI_NULLS ON
|
|
GO
|
|
SET QUOTED_IDENTIFIER ON
|
|
GO
|
|
-- =============================================
|
|
-- Author: <Author,,Name>
|
|
-- Create date: <Create Date,,>
|
|
-- Description: <Description,,>
|
|
-- =============================================
|
|
CREATE FUNCTION <Table_Function_Name, sysname, FunctionName>
|
|
(
|
|
-- Add the parameters for the function here
|
|
<@param1, sysname, @p1> <data_type_for_param1, , int>,
|
|
<@param2, sysname, @p2> <data_type_for_param2, , char>
|
|
)
|
|
RETURNS
|
|
<@Table_Variable_Name, sysname, @Table_Var> TABLE
|
|
(
|
|
-- Add the column definitions for the TABLE variable here
|
|
<Column_1, sysname, c1> <Data_Type_For_Column1, , int>,
|
|
<Column_2, sysname, c2> <Data_Type_For_Column2, , int>
|
|
)
|
|
AS
|
|
BEGIN
|
|
-- Fill the table variable with the rows for your result set
|
|
|
|
RETURN
|
|
END
|
|
GO |