|
SET QUOTED_IDENTIFIER OFF;
SET ANSI_NULLS ON;
SET NOCOUNT ON;
GO
IF object_id('<PREFIX,,>_<FUNCTION_NAME,,>') IS NOT NULL
BEGIN
PRINT 'Dropping Function <PREFIX,,>_<FUNCTION_NAME,,>.';
DROP FUNCTION <PREFIX,,>_<FUNCTION_NAME,,>;
END
GO
/*
* ====================================================================
* BASIC INFORMATION
* ====================================================================
*
* --Project Name : <PROJECT_NAME,,>
* --Client Name : <CLIENT_NAME,,>
* --Function name : <PREFIX,,>_<FUNCTION_NAME,,>
* --Purpose/Function : <PURPOSE,,>
* --Author : <AUTHOR,,>
* --Start Date(MM-DD-YYYY) : <START_DATE(MM-DD-YYYY),,>
*
* ====================================================================
* IMPLEMENTATION LOGIC
* ====================================================================
*
* --<IMPLEMENTATION_LOGIC,,>
*
* ====================================================================
* PERFORMANCE (To be filled up by developer,with "Yes" values)
* ====================================================================
*
* --TSQL reviewed : No
* --Indexing done properly : No
* --Index fragmentation checked: No
* --Comment : No comment
*
* ===================================================================
* REVIEW (To be filled up by reviewer,with "Yes" values)
* ===================================================================
*
* --Reviewed by : <REVIEWER_NAME,,>
* --Review date :
* --TSQL reviewed : No
* --Indexing done properly : No
* --Index fragmentation checked: No
* --Comment : No comment
*
* ===================================================================*/
-------------------------------------------------------------------------------
-- METADATA AND OTHER MESSAGES ABOVE.
-- BEGIN CREATE STATEMENTS.
-------------------------------------------------------------------------------
CREATE FUNCTION [dbo].[<PREFIX,,>_<FUNCTION_NAME,,>]()
RETURNS TABLE
AS RETURN
(
--Modify the following TSQL according to your need
SELECT TOP 5 journalistID,UserName FROM journalists
)
GO
-------------------------------------------------------------------------------
-- END OF CREATE STATEMENTS.
-- METADATA AND SUCCESS/ERROR MESSAGES BELOW.
-------------------------------------------------------------------------------
IF object_id('<PREFIX,,>_<FUNCTION_NAME,,>') IS NOT NULL
BEGIN
PRINT 'Function <PREFIX,,>_<FUNCTION_NAME,,> created successfully.';
END
ELSE
BEGIN
PRINT 'ERROR: Failed to create Function <PREFIX,,>_<FUNCTION_NAME,,>.';
END
GO
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.