sys.sql_modules (Transact-SQL)sys.sql_modules (Transact-SQL)
SQL Server
Azure SQL-Datenbank
Azure Synapse Analytics (SQL DW)
Parallel Data Warehouse
SQL Server
Azure SQL Database
Azure Synapse Analytics (SQL DW)
Parallel Data Warehouse
Gibt eine Zeile für jedes Objekt, das ist eine SQL-Sprache definiertes Modul in SQL ServerSQL Server, einschließlich systemintern kompilierte benutzerdefinierte Skalarfunktion.Returns a row for each object that is an SQL language-defined module in SQL ServerSQL Server, including natively compiled scalar user-defined function. Objekten des Typs P, RF, V, TR, FN, IF, TF und R ist ein SQL-Modul zugeordnet.Objects of type P, RF, V, TR, FN, IF, TF, and R have an associated SQL module. Eigenständige Standards, Objekte des Typs D, haben ebenfalls eine SQL-Moduldefinition in dieser Sicht.Stand-alone defaults, objects of type D, also have an SQL module definition in this view. Eine Beschreibung dieser Typen finden Sie in der Typ -Spalte in der sys.objects -Katalogsicht angezeigt.For a description of these types, see the type column in the sys.objects catalog view.
Weitere Informationen dazu finden Sie unter Benutzerdefinierte Skalarfunktionen für In-Memory-OLTP.For more information, see Scalar User-Defined Functions for In-Memory OLTP.
SpaltennameColumn name | DatentypData type | BeschreibungDescription |
---|---|---|
object_idobject_id | intint | Die Objekt-ID des enthaltenen Objekts.ID of the object of the containing object. Ist innerhalb einer Datenbank eindeutig.Is unique within a database. |
definitiondefinition | nvarchar(max)nvarchar(max) | Der SQL-Text, der dieses Modul definiert.SQL text that defines this module. Dieser Wert kann auch mit abgerufen werden die OBJECT_DEFINITION integrierte Funktion.This value can also be obtained using the OBJECT_DEFINITION built-in function. NULL = Verschlüsselt.NULL = Encrypted. |
uses_ansi_nullsuses_ansi_nulls | bitbit | Das Modul wurde mit SET ANSI_NULLS ON erstellt.Module was created with SET ANSI_NULLS ON. Ist immer = 0 für Regeln und Standardwerte.Will always be = 0 for rules and defaults. |
uses_quoted_identifieruses_quoted_identifier | bitbit | Das Modul wurde mit SET QUOTED_IDENTIFIER ON erstellt.Module was created with SET QUOTED_IDENTIFIER ON. |
is_schema_boundis_schema_bound | bitbit | Das Modul wurde mit der Option SCHEMABINDING erstellt.Module was created with SCHEMABINDING option. Enthält immer den Wert 1 für systemintern kompilierte gespeicherte Prozeduren.Always contains a value of 1 for natively compiled stored procedures. |
uses_database_collationuses_database_collation | bitbit | 1 = Die richtige Auswertung der schemagebundenen Moduldefinition ist abhängig von der Standardsortierung der Datenbank; andernfalls ist der Wert 0.1 = Schema-bound module definition depends on the default-collation of the database for correct evaluation; otherwise, 0. Diese Abhängigkeit wird verhindert, dass die standardsortierung der Datenbank geändert wird.Such a dependency prevents changing the database's default collation. |
is_recompiledis_recompiled | bitbit | Die Prozedur wurde mit der Option WITH RECOMPILE erstellt.Procedure was created WITH RECOMPILE option. |
null_on_null_inputnull_on_null_input | bitbit | Das Modul wurde so deklariert, dass auf eine NULL-Eingabe eine NULL-Ausgabe folgt.Module was declared to produce a NULL output on any NULL input. |
execute_as_principal_idexecute_as_principal_id | IntInt | Die ID des Datenbankprinzipals EXECUTE AS.ID of the EXECUTE AS database principal. NULL als Standardwert oder bei Verwendung von EXECUTE AS CALLER.NULL by default or if EXECUTE AS CALLER. ID des angegebenen Prinzipals bei EXECUTE AS SELF oder EXECUTE AS <principal >.ID of the specified principal if EXECUTE AS SELF or EXECUTE AS <principal>. -2 = EXECUTE AS OWNER.-2 = EXECUTE AS OWNER. |
uses_native_compilationuses_native_compilation | bitbit | Gilt für: SQL Server 2014 (12.x)SQL Server 2014 (12.x) bis SQL Server 2014 (12.x)SQL Server 2014 (12.x).Applies to: SQL Server 2014 (12.x)SQL Server 2014 (12.x) through SQL Server 2014 (12.x)SQL Server 2014 (12.x). 0 = nicht systemintern kompiliert0 = not natively compiled 1 = systemintern kompiliert1 = is natively compiled Der Standardwert ist 0.The default value is 0. |
is_inlineableis_inlineable | bitbit | Gilt für: SQL Server 2019 (15.x)SQL Server 2019 (15.x) und höher.Applies to: SQL Server 2019 (15.x)SQL Server 2019 (15.x) and later. Gibt an, ob das Modul inlineable oder nicht.Indicates whether the module is inlineable or not. Inlinefähigkeit basiert darauf, dass die angegebenen Bedingungen hier.Inlineability is based on the conditions specified here. 0 = nicht inlineable0 = not inlineable 1 = inlineable ist.1 = is inlineable. Für skalare benutzerdefinierte Funktionen wird der Wert 1 sein, wenn die UDF inlineable 0, andernfalls ist.For scalar UDFs, the value will be 1 if the UDF is inlineable, and 0 otherwise. Er enthält immer den Wert 1 für Inline-Tabellenwertfunktionen und 0 für alle anderen Modultypen.It always contains a value of 1 for inline TVFs, and 0 for all other module types. |
inline_typeinline_type | bitbit | Gilt für: SQL Server 2019 (15.x)SQL Server 2019 (15.x) und höher.Applies to: SQL Server 2019 (15.x)SQL Server 2019 (15.x) and later. Gibt an, ob inlining ist derzeit für das Modul eingeschaltet.Indicates whether inlining is turned on for the module currently. 0 = inlining ist deaktiviert.0 = inlining is turned off 1 = inlining ist aktiviert.1 = inlining is turned on. Für skalare benutzerdefinierte Funktionen, wird der Wert 1 sein, wenn inlining ist aktiviert (explizit oder implizit).For scalar UDFs, the value will be 1 if inlining is turned on (explicitly or implicitly). Der Wert ist immer 1 für Inline-Tabellenwertfunktionen und 0 für andere Modultypen sein.The value will always be 1 for inline TVFs, and 0 for other module types. |
HinweiseRemarks
Der SQL-Ausdruck für eine DEFAULT-Einschränkung, Objekt vom Typ D, befindet sich der Sys. default_constraints -Katalogsicht angezeigt.The SQL expression for a DEFAULT constraint, object of type D, is found in the sys.default_constraints catalog view. Der SQL-Ausdruck für eine CHECK-Einschränkung, Objekt vom Typ C, befindet sich der Sys. check_constraints -Katalogsicht angezeigt.The SQL expression for a CHECK constraint, object of type C, is found in the sys.check_constraints catalog view.
Diese Informationen finden Sie auch auf dm_db_uncontained_entities (Transact-SQL).This information is also described in sys.dm_db_uncontained_entities (Transact-SQL).
BerechtigungenPermissions
Die Sichtbarkeit der Metadaten in Katalogsichten ist auf sicherungsfähige Elemente eingeschränkt, bei denen der Benutzer entweder der Besitzer ist oder für die dem Benutzer eine Berechtigung erteilt wurde.The visibility of the metadata in catalog views is limited to securables that a user either owns or on which the user has been granted some permission. Weitere Informationen finden Sie unter Metadata Visibility Configuration.For more information, see Metadata Visibility Configuration.
BeispieleExamples
Im folgenden Beispiel werden der Name, der Typ und die Definition der einzelnen Module in der aktuellen Datenbank zurückgegeben.The following example returns the name, type, and definition of each module in the current database.
SELECT sm.object_id, OBJECT_NAME(sm.object_id) AS object_name, o.type, o.type_desc, sm.definition
FROM sys.sql_modules AS sm
JOIN sys.objects AS o ON sm.object_id = o.object_id
ORDER BY o.type;
GO
Siehe auchSee Also
Katalogsichten (Transact-SQL) Catalog Views (Transact-SQL)
Katalogsichten für Objekte (Transact-SQL) Object Catalog Views (Transact-SQL)
Abfragen des Systemkatalogs von SQL Server – häufig gestellte Fragen Querying the SQL Server System Catalog FAQ
In-Memory-OLTP (Arbeitsspeicheroptimierung)In-Memory OLTP (In-Memory Optimization)
Feedback
Feedback wird geladen...