Created
September 17, 2012 06:43
Template for creating and testing SQL table-valued functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Template for creating and testing SQL table-valued functions | |
IF EXISTS | |
(SELECT * FROM sys.objects | |
WHERE object_id = OBJECT_ID(N'ufnSomeFunction') | |
AND type in (N'FN', N'IF', N'TF', N'FS', N'FT')) | |
DROP FUNCTION [dbo].[ufnSomeFunction] | |
GO | |
CREATE FUNCTION [dbo].[ufnSomeFunction] | |
( | |
@Var1 DATETIME, @Var2 UNIQUEIDENTIFIER | |
) | |
RETURNS TABLE | |
RETURN | |
SELECT * FROM SomeTable | |
GO | |
SELECT * FROM [dbo].[ufnSomeFunction](NULL, NULL) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment