first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

T-SQL: User-Defined Function Structure; Table/Set Form

USE [Database] GO

IF OBJECT_ID('fUserDefined') IS NOT NULL BEGIN DROP FUNCTION fUserDefined IF OBJECT_ID('fUserDefined') IS NOT NULL PRINT '<<< FAILED DROPPING FUNCTION fUserDefined >>>' ELSE PRINT '<<< DROPPED FUNCTION fUserDefined >>>' END GO

CREATE FUNCTION dbo.fUserDefined ( @param1 varchar(255) = NULL ) RETURNS @set TABLE (idx smallint PRIMARY KEY, value varchar(1024)) AS BEGIN

/* Description: Developer: Bryan Wilhite

INSERT INTO @set (idx, value) VALUES (@idx, @value)

*/

RETURN END GO

GRANT SELECT ON fUserDefined TO public GO

IF OBJECT_ID('fUserDefined') IS NOT NULL PRINT '<<< CREATED FUNCTION fUserDefined >>>' ELSE PRINT '<<< FAILED CREATING FUNCTION fUserDefined >>>' GO

mod date: 2007-03-20T02:51:58.000Z