Table of Contents

Class InformationSchema.Routine

Namespace
LinqToDB.Tools.DataProvider.SqlServer.Schemas
Assembly
linq2db.Tools.dll

ROUTINES (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Returns one row for each stored procedure and function that can be accessed by the current user in the current database. The columns that describe the return value apply only to functions. For stored procedures, these columns will be NULL.
To retrieve information from these views, specify the fully qualified name of INFORMATION_SCHEMA.*view_name*.

note


The ROUTINE_DEFINITION column contains the source statements that created the function or stored procedure. These source statements are likely to contain embedded carriage returns. If you are returning this column to an application that displays the results in a text format, the embedded carriage returns in the ROUTINE_DEFINITION results may affect the formatting of the overall result set. If you select the ROUTINE_DEFINITION column, you must adjust for the embedded carriage returns; for example, by returning the result set into a grid or returning ROUTINE_DEFINITION into its own text box.


See INFORMATION_SCHEMA.ROUTINES.

[Table(Schema = "INFORMATION_SCHEMA", Name = "ROUTINES", IsView = true)]
public class InformationSchema.Routine
Inheritance
InformationSchema.Routine
Extension Methods

Properties

CharacterMaximumLength

Maximum length in characters, if the return type is a character type.

-1 for xml and large-value type data.

[Column("CHARACTER_MAXIMUM_LENGTH")]
[Nullable]
public int? CharacterMaximumLength { get; set; }

Property Value

int?

CharacterOctetLength

Maximum length in bytes, if the return type is a character type.

-1 for xml and large-value type data.

[Column("CHARACTER_OCTET_LENGTH")]
[Nullable]
public int? CharacterOctetLength { get; set; }

Property Value

int?

CharacterSetCatalog

Always returns NULL.

[Column("CHARACTER_SET_CATALOG")]
[Nullable]
public string? CharacterSetCatalog { get; set; }

Property Value

string

CharacterSetName

Name of the character set of the return value. For noncharacter types, returns NULL.

[Column("CHARACTER_SET_NAME")]
[Nullable]
public string? CharacterSetName { get; set; }

Property Value

string

CharacterSetSchema

Always returns NULL.

[Column("CHARACTER_SET_SCHEMA")]
[Nullable]
public string? CharacterSetSchema { get; set; }

Property Value

string

CollationCatalog

Always returns NULL.

[Column("COLLATION_CATALOG")]
[Nullable]
public string? CollationCatalog { get; set; }

Property Value

string

CollationName

Collation name of the return value. For noncharacter types, returns NULL.

[Column("COLLATION_NAME")]
[Nullable]
public string? CollationName { get; set; }

Property Value

string

CollationSchema

Always returns NULL.

[Column("COLLATION_SCHEMA")]
[Nullable]
public string? CollationSchema { get; set; }

Property Value

string

Created

Time when the routine was created.

[Column("CREATED")]
[NotNull]
public DateTime Created { get; set; }

Property Value

DateTime

DataType

Data type of the return value of the function. Returns table if a table-valued function.

[Column("DATA_TYPE")]
[Nullable]
public string? DataType { get; set; }

Property Value

string

DatetimePrecision

Fractional precision of a second if the return value is of type datetime. Otherwise, returns NULL.

[Column("DATETIME_PRECISION")]
[Nullable]
public short? DatetimePrecision { get; set; }

Property Value

short?

DtdIdentifier

NULL. Reserved for future use.

[Column("DTD_IDENTIFIER")]
[Nullable]
public string? DtdIdentifier { get; set; }

Property Value

string

ExternalLanguage

NULL. Reserved for future use.

[Column("EXTERNAL_LANGUAGE")]
[Nullable]
public string? ExternalLanguage { get; set; }

Property Value

string

ExternalName

NULL. Reserved for future use.

[Column("EXTERNAL_NAME")]
[Nullable]
public string? ExternalName { get; set; }

Property Value

string

IntervalPrecision

NULL. Reserved for future use.

[Column("INTERVAL_PRECISION")]
[Nullable]
public short? IntervalPrecision { get; set; }

Property Value

short?

IntervalType

NULL. Reserved for future use.

[Column("INTERVAL_TYPE")]
[Nullable]
public string? IntervalType { get; set; }

Property Value

string

IsDeterministic

Returns YES if the routine is deterministic.

Returns NO if the routine is nondeterministic.

Always returns NO for stored procedures.

[Column("IS_DETERMINISTIC")]
[Nullable]
public string? IsDeterministic { get; set; }

Property Value

string

IsImplicitlyInvocable

Returns YES if the routine can be implicitly invoked, and NO if function cannot be implicitly invoked.

Always returns NO.

[Column("IS_IMPLICITLY_INVOCABLE")]
[Nullable]
public string? IsImplicitlyInvocable { get; set; }

Property Value

string

IsNullCall

Indicates whether the routine will be called if any one of its arguments is NULL.

[Column("IS_NULL_CALL")]
[Nullable]
public string? IsNullCall { get; set; }

Property Value

string

IsUserDefinedCast

Returns YES if user-defined cast function, and NO if not a user-defined cast function.

Always returns NO.

[Column("IS_USER_DEFINED_CAST")]
[Nullable]
public string? IsUserDefinedCast { get; set; }

Property Value

string

LastAltered

The last time the function was modified.

[Column("LAST_ALTERED")]
[NotNull]
public DateTime LastAltered { get; set; }

Property Value

DateTime

MaxDynamicResultSets

Maximum number of dynamic result sets returned by routine.

Returns 0 if functions.

[Column("MAX_DYNAMIC_RESULT_SETS")]
[Nullable]
public short? MaxDynamicResultSets { get; set; }

Property Value

short?

MaximumCardinality

NULL. Reserved for future use.

[Column("MAXIMUM_CARDINALITY")]
[Nullable]
public long? MaximumCardinality { get; set; }

Property Value

long?

ModuleCatalog

NULL. Reserved for future use.

[Column("MODULE_CATALOG")]
[Nullable]
public string? ModuleCatalog { get; set; }

Property Value

string

ModuleName

NULL. Reserved for future use.

[Column("MODULE_NAME")]
[Nullable]
public string? ModuleName { get; set; }

Property Value

string

ModuleSchema

NULL. Reserved for future use.

[Column("MODULE_SCHEMA")]
[Nullable]
public string? ModuleSchema { get; set; }

Property Value

string

NumericPrecision

Numeric precision of the return value. For the nonnumeric types, returns NULL.

[Column("NUMERIC_PRECISION")]
[Nullable]
public short? NumericPrecision { get; set; }

Property Value

short?

NumericPrecisionRadix

Numeric precision radix of the return value. For nonnumeric types, returns NULL.

[Column("NUMERIC_PRECISION_RADIX")]
[Nullable]
public short? NumericPrecisionRadix { get; set; }

Property Value

short?

NumericScale

Scale of the return value. For nonnumeric types, returns NULL.

[Column("NUMERIC_SCALE")]
[Nullable]
public short? NumericScale { get; set; }

Property Value

short?

ParameterStyle

NULL. Reserved for future use.

[Column("PARAMETER_STYLE")]
[Nullable]
public string? ParameterStyle { get; set; }

Property Value

string

RoutineBody

Returns SQL for a Transact-SQL function and EXTERNAL for an externally written function.

Functions will always be SQL.

[Column("ROUTINE_BODY")]
[Nullable]
public string? RoutineBody { get; set; }

Property Value

string

RoutineCatalog

Catalog name of the function.

[Column("ROUTINE_CATALOG")]
[Nullable]
public string? RoutineCatalog { get; set; }

Property Value

string

RoutineDefinition

Returns the first 4000 characters of the definition text of the function or stored procedure if the function or stored procedure is not encrypted. Otherwise, returns NULL.

To ensure that you obtain the complete definition, query the OBJECT_DEFINITION function or the definition column in the sys.sql_modules catalog view.

[Column("ROUTINE_DEFINITION")]
[Nullable]
public string? RoutineDefinition { get; set; }

Property Value

string

RoutineName

Name of the function.

[Column("ROUTINE_NAME")]
[NotNull]
public string RoutineName { get; set; }

Property Value

string

RoutineSchema

Name of the schema that contains this function.

Important *</strong>* Do not use INFORMATION_SCHEMA views to determine the schema of an object. INFORMATION_SCHEMA views only represent a subset of the metadata of an object. The only reliable way to find the schema of a object is to query the sys.objects catalog view.

[Column("ROUTINE_SCHEMA")]
[Nullable]
public string? RoutineSchema { get; set; }

Property Value

string

RoutineType

Returns PROCEDURE for stored procedures, and FUNCTION for functions.

[Column("ROUTINE_TYPE")]
[Nullable]
public string? RoutineType { get; set; }

Property Value

string

SchemaLevelRoutine

Returns YES if schema-level function, or NO if not a schema-level function.

Always returns YES.

[Column("SCHEMA_LEVEL_ROUTINE")]
[Nullable]
public string? SchemaLevelRoutine { get; set; }

Property Value

string

ScopeCatalog

NULL. Reserved for future use.

[Column("SCOPE_CATALOG")]
[Nullable]
public string? ScopeCatalog { get; set; }

Property Value

string

ScopeName

NULL. Reserved for future use.

[Column("SCOPE_NAME")]
[Nullable]
public string? ScopeName { get; set; }

Property Value

string

ScopeSchema

NULL. Reserved for future use.

[Column("SCOPE_SCHEMA")]
[Nullable]
public string? ScopeSchema { get; set; }

Property Value

string

SpecificCatalog

Specific name of the catalog. This name is the same as ROUTINE_CATALOG.

[Column("SPECIFIC_CATALOG")]
[Nullable]
public string? SpecificCatalog { get; set; }

Property Value

string

SpecificName

Specific name of the catalog. This name is the same as ROUTINE_NAME.

[Column("SPECIFIC_NAME")]
[NotNull]
public string SpecificName { get; set; }

Property Value

string

SpecificSchema

Specific name of the schema.

Important *</strong>* Do not use INFORMATION_SCHEMA views to determine the schema of an object. INFORMATION_SCHEMA views only represent a subset of the metadata of an object. The only reliable way to find the schema of a object is to query the sys.objects catalog view.

[Column("SPECIFIC_SCHEMA")]
[Nullable]
public string? SpecificSchema { get; set; }

Property Value

string

SqlDataAccess

Returns one of the following values:

NONE = Function does not contain SQL.

CONTAINS = Function possibly contains SQL.

READS = Function possibly reads SQL data.

MODIFIES = Function possibly modifies SQL data.

Returns READS for all functions, and MODIFIES for all stored procedures.

[Column("SQL_DATA_ACCESS")]
[Nullable]
public string? SqlDataAccess { get; set; }

Property Value

string

SqlPath

NULL. Reserved for future use.

[Column("SQL_PATH")]
[Nullable]
public string? SqlPath { get; set; }

Property Value

string

TypeUdtCatalog

NULL. Reserved for future use.

[Column("TYPE_UDT_CATALOG")]
[Nullable]
public string? TypeUdtCatalog { get; set; }

Property Value

string

TypeUdtName

NULL. Reserved for future use.

[Column("TYPE_UDT_NAME")]
[Nullable]
public string? TypeUdtName { get; set; }

Property Value

string

TypeUdtSchema

NULL. Reserved for future use.

[Column("TYPE_UDT_SCHEMA")]
[Nullable]
public string? TypeUdtSchema { get; set; }

Property Value

string

UdtCatalog

NULL. Reserved for future use.

[Column("UDT_CATALOG")]
[Nullable]
public string? UdtCatalog { get; set; }

Property Value

string

UdtName

NULL. Reserved for future use.

[Column("UDT_NAME")]
[Nullable]
public string? UdtName { get; set; }

Property Value

string

UdtSchema

NULL. Reserved for future use.

[Column("UDT_SCHEMA")]
[Nullable]
public string? UdtSchema { get; set; }

Property Value

string