Created
January 17, 2013 16:27
-
-
Save kmoormann/4557262 to your computer and use it in GitHub Desktop.
user defined function definition for sql server
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
USE DER_CommProg; | |
GO | |
CREATE TABLE #functionInfo | |
( | |
ID BIGINT NOT NULL | |
,Name VARCHAR(200) NULL | |
,[SchemaName] VARCHAR(200) NULL | |
,[Description] VARCHAR(200) NULL | |
,[Definition] VARCHAR(MAX) NULL | |
) | |
INSERT INTO #functionInfo | |
SELECT | |
object_id | |
,name AS function_name | |
,SCHEMA_NAME(schema_id) AS schema_name | |
,type_desc | |
,OBJECT_DEFINITION(object_id) | |
FROM sys.objects | |
WHERE type_desc LIKE '%FUNCTION%' | |
ORDER BY 1,2,3,4; | |
GO | |
SELECT Definition FROM #functionInfo ORDER BY Name | |
DROP TABLE #functionInfo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment