Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



INFORMATION_SCHEMA.ROUTINES

  No additional text.


Syntax
CREATE VIEW INFORMATION_SCHEMA.ROUTINES
AS
SELECT
	DB_NAME()					AS SPECIFIC_CATALOG,
	SCHEMA_NAME(o.schema_id)	AS SPECIFIC_SCHEMA,
	o.name						AS SPECIFIC_NAME,
	DB_NAME()					AS ROUTINE_CATALOG,
	SCHEMA_NAME(o.schema_id)	AS ROUTINE_SCHEMA,
	o.name						AS ROUTINE_NAME,
	convert(nvarchar(20), CASE
		WHEN o.type IN ('P','PC')
		THEN 'PROCEDURE'
		ELSE 'FUNCTION' END)		AS ROUTINE_TYPE,
	convert(sysname, null)			AS MODULE_CATALOG,
	convert(sysname, null)			AS MODULE_SCHEMA,
	convert(sysname, null)			AS MODULE_NAME,
	convert(sysname, null)			AS UDT_CATALOG,
	convert(sysname, null)			AS UDT_SCHEMA,
	convert(sysname, null)			AS UDT_NAME,
	convert(sysname, CASE
		WHEN o.type IN ('TF', 'IF', 'FT') THEN N'TABLE'
		ELSE ISNULL(type_name(c.system_type_id),
			type_name(c.user_type_id)) END)		AS DATA_TYPE,
	ColumnProperty(c.object_id, c.name, 'charmaxlen')	AS CHARACTER_MAXIMUM_LENGTH,
	ColumnProperty(c.object_id, c.name, 'octetmaxlen')	AS CHARACTER_OCTET_LENGTH,
	convert(sysname, null)			AS COLLATION_CATALOG,
	convert(sysname, null)			AS COLLATION_SCHEMA,
	convert(sysname, CASE
		WHEN c.system_type_id IN (35, 99, 167, 175, 231, 239)	-- [n]char/[n]varchar/[n]text
		THEN CollationPropertyFromId(-1, 'name') END)	AS COLLATION_NAME,
	convert(sysname, null)			AS CHARACTER_SET_CATALOG,
	convert(sysname, null)			AS CHARACTER_SET_SCHEMA,
	convert(sysname, CASE
		WHEN c.system_type_id IN (35, 167, 175)
		THEN ServerProperty('sqlcharsetname') -- char/varchar/text
		WHEN c.system_type_id IN (99, 231, 239)
		THEN N'UNICODE'	-- nchar/nvarchar/ntext
		END)				AS CHARACTER_SET_NAME,
	convert(tinyint, CASE -- int/decimal/numeric/real/float/money
		WHEN c.system_type_id IN (48, 52, 56, 59, 60, 62, 106, 108, 122, 127) THEN c.precision
		END)										AS NUMERIC_PRECISION,
	convert(smallint, CASE	-- int/money/decimal/numeric
		WHEN c.system_type_id IN (48, 52, 56, 60, 106, 108, 122, 127) THEN 10
		WHEN c.system_type_id IN (59, 62) THEN 2 END)	AS NUMERIC_PRECISION_RADIX, -- real/float
	convert(int, CASE	-- datetime/smalldatetime
		WHEN c.system_type_id IN (40, 41, 42, 43, 58, 61) THEN NULL
		ELSE odbcscale(c.system_type_id, c.scale) END)	AS NUMERIC_SCALE,
	convert(smallint, CASE -- datetime/smalldatetime
		WHEN c.system_type_id IN (40, 41, 42, 43, 58, 61) THEN odbcscale(c.system_type_id, c.scale) END)	AS DATETIME_PRECISION,
	convert(nvarchar(30), null)			AS INTERVAL_TYPE,
	convert(smallint, null)				AS INTERVAL_PRECISION,
	convert(sysname, null)				AS TYPE_UDT_CATALOG,
	convert(sysname, null)				AS TYPE_UDT_SCHEMA,
	convert(sysname, null)				AS TYPE_UDT_NAME,
	convert(sysname, null)				AS SCOPE_CATALOG,
	convert(sysname, null)				AS SCOPE_SCHEMA,
	convert(sysname, null)				AS SCOPE_NAME,
	convert(bigint, null)				AS MAXIMUM_CARDINALITY,
	convert(sysname, null)				AS DTD_IDENTIFIER,
	convert(nvarchar(30), CASE
		WHEN o.type IN ('P ', 'FN', 'TF', 'IF') THEN 'SQL'
		ELSE 'EXTERNAL' END)			AS ROUTINE_BODY,
	convert(nvarchar(4000),
		object_definition(o.object_id))	AS ROUTINE_DEFINITION,
	convert(sysname, null)				AS EXTERNAL_NAME,
	convert(nvarchar(30), null)			AS EXTERNAL_LANGUAGE,
	convert(nvarchar(30), null)			AS PARAMETER_STYLE,
	convert(nvarchar(10), CASE
		WHEN ObjectProperty(o.object_id, 'IsDeterministic') = 1
		THEN 'YES' ELSE 'NO' END)		AS IS_DETERMINISTIC,
	convert(nvarchar(30), CASE
		WHEN o.type IN ('P', 'PC') THEN 'MODIFIES'
		ELSE 'READS' END)				AS SQL_DATA_ACCESS,
	convert(nvarchar(10), CASE
		WHEN o.type in ('P', 'PC') THEN null
		WHEN o.null_on_null_input = 1 THEN 'YES'
		ELSE 'NO' END)				AS IS_NULL_CALL,
	convert(sysname, null)				AS SQL_PATH,
	convert(nvarchar(10), 'YES')	AS SCHEMA_LEVEL_ROUTINE,
	convert(smallint, CASE
		WHEN o.type IN ('P ', 'PC')
		THEN -1 ELSE 0 END)			AS MAX_DYNAMIC_RESULT_SETS,
	convert(nvarchar(10), 'NO')			AS IS_USER_DEFINED_CAST,
	convert(nvarchar(10), 'NO')			AS IS_IMPLICITLY_INVOCABLE,
	o.create_date						AS CREATED,
	o.modify_date						AS LAST_ALTERED
FROM
	sys.objects$ o LEFT JOIN sys.parameters c
	ON (c.object_id = o.object_id AND c.parameter_id = 0)
WHERE
	o.type IN ('P', 'FN', 'TF', 'IF', 'AF', 'FT', 'IS', 'PC', 'FS')

 
Last revision 2008RTM
See also

  sp_MSarticle_validation (Procedure)
sp_MSgen_sync_tran_procs (Procedure)
sp_MSpublication_validation (Procedure)
sp_MStable_validation (Procedure)
sp_MSvalidatearticle (Procedure)
sp_table_validation (Procedure)
       



News

  Query a named instance
Sybase+ASE+silent+install
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash