sys.sp_xtp_control_proc_exec_stats (Transact-SQL)

Gilt für:SQL Server

Aktiviert die Statistiksammlung für systemintern kompilierte gespeicherte Prozeduren für die Instanz.

Informationen zum Aktivieren der Statistikauflistung auf Abfrageebene für nativ kompilierte gespeicherte Prozeduren finden Sie unter sys.sp_xtp_control_query_exec_stats (Transact-SQL).

Syntax

sys.sp_xtp_control_proc_exec_stats
    [ [ @new_collection_value = ] collection_value ]
    , [ @old_collection_value = ] old_collection_value OUTPUT
[ ; ]

Argumente

[ @new_collection_value = ] new_collection_value

Bestimmt, ob die Statistikauflistung auf Prozedurebene aktiviert (1) oder deaktiviert ist (0). @new_collection_value ist bit.

@new_collection_value ist auf Null festgelegt, wenn SQL Server oder die Datenbank gestartet werden.

[ @old_collection_value = ] old_collection_value

Gibt den aktuellen Status zurück. @old_collection_value ist bit.

Rückgabecodewerte

0 für Erfolg. Ungleich 0 für Fehler.

Berechtigungen

Erfordert die Mitgliedschaft in der Festen Sysadmin-Rolle .

Beispiele

So legen Sie @new_collection_value und Abfrage für den Wert von @new_collection_value fest:

EXEC sys.sp_xtp_control_proc_exec_stats @new_collection_value = 1;

DECLARE @c BIT;

EXEC sys.sp_xtp_control_proc_exec_stats @old_collection_value = @c OUTPUT;

SELECT @c AS 'collection status';