Export (0) Print
Expand All
Expand Minimize

sys.sp_xtp_control_proc_exec_stats (Transact-SQL)

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

Enables statistics collection for natively compiled stored procedures for the instance.

To enable statistics collection at the query level for natively compiled stored procedures, see sys.sp_xtp_control_query_exec_stats (Transact-SQL).

Applies to: SQL Server (SQL Server 2014 through current version).

sp_xtp_control_proc_exec_stats [ [ @new_collection_value = ] collection_value ], [ @old_collection_value]

@new_collection_value = value

Determines whether procedure-level statistics collection is on (1) or off (0).

@new_collection_value is set to zero when SQL Server or the database starts.

@old_collection_value = value

Returns the current status.

0 for success. Nonzero for failure.

Requires membership in the fixed sysadmin role.

To set @new_collection_value and query for the value of @new_collection_value:

exec [sys].[sp_xtp_control_proc_exec_stats] @new_collection_value = 1
declare @c bit
exec sp_xtp_control_proc_exec_stats @old_collection_value=@c output
select @c as 'collection status'
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2015 Microsoft