The sp_whopro™ script is a SQL Server Activity Monitoring and Logging Stored Procedure. If you have used sp_who or sp_who2, you will find sp_whopro very helpful, sp_whopro is versatile and easy to use.
You can also find info about the script in our sp_whopro videos (Youtube).
sp_whopro lets you monitor current activity of a SQL Server Instance and at the same time allows you to save the activity to database for later analysis. You can collect data related toCPU, IO, MEMORY, NETWORK, WAIT, BLOCKING, LOCK, TRANSACTION, TEMPDB, CURSOR, SQL, PLAN, STATS, QUERY_PROFILE, SESSION, CONNECTION, REQUEST, TASK, WORKER and THREAD.
The sp_whopro script is customized for every SQL Server Version and Service Pack Microsoft released from SQL Server 2005 SP4 to SQL Server 2014. You can import current activity from many SQL Server Instances into a single central instance, server name and ctime, the data collection time is part of the collection.
--Example parameters to monitor waits, blocking and corresponding locks:
exec sp_whopro 'active, blocking', 'sql, wait, block, locks, limited'
go
--Example parameters to monitor waits, blocking and corresponding locks and to save the data to current database:
exec sp_whopro 'active, blocking, save', 'sql, wait, block, locks, limited'
go
--Example parameters to monitor waits, blocking and corresponding locks and to save the data to ‘sp_whopro_db’ database in a SQL Agent job without output:
exec sp_whopro 'active, blocking, save, nooutput', 'sql, wait, block, locks, limited', null, 'sp_whopro_db'
go
--Example parameters to retrieve saved data from ‘sp_whopro_db’ database:
exec sp_whopro null, 'sql, wait, block, locks, limited', null, 'sp_whopro_db', '2014-10-16 08:24:13.270','2014-10-18 08:24:13.270'
go
--Example parameters to output the select statement used to retrieve saved data from ‘sp_whopro_db’ database:
exec sp_whopro 'nooutput', 'sql, wait, block, locks, limited', null, 'sp_whopro_db', '2014-10-16 08:24:13.270','2014-10-18 08:24:13.270'
go
use master
exec sp_whopro 'help'
go
/* For latest build of sp_whopro, help and documentation, refer to http://www.sqldownload.com
sp_whopro [@sessions =] 'option[, option]' | NULL, [@columns =] 'option[, option]' | 'column[, column]' | NULL, [@order_by =] 'column[, column]' | 'help' | NULL, [@save_to_database =] 'database_name' | NULL, [@datetime = OUTPUT] 'ctime' | NULL, [@datetime_to =] 'ctime' | NULL, [@execution_time_report_threshold =] milliseconds | NULL
[@sessions =] 'option[, option]' | NULL
The following options are a comma separated list, can be used to filter sessions as shown below:
Example ACTIVE, SAVE
ACTIVE
Include Active sessions.
NULL
Include Active and Blocking sessions. When 'in', 'not in', '>', '<', '=', 'like'
or 'not like' is specified include All sessions
WAIT
Include Waiting sessions.
BLOCK
Include Blocked and Blocking sessions.
BLOCKED
Include Blocked sessions.
BLOCKING
Include Blocking sessions.
CURSOR
Sessions that have open cursors.
SP_WHOPRO
Include sp_whopro's own session.
ALL
Include All sessions.
SAVE
Save output.
NOOUTPUT
To not to display results, to be used in combination with SAVE when run as a job or
to get the select statement when @datetime is supplied.
The following 'in' / 'not in' options are a comma separated list, can be used to filter sessions as shown below:
Example session_id IN (57, 58)
Example database_name IN ('SQLDev', 'SQLTest'), session_id NOT IN (57, 58)
session_id [IN | NOT IN] (?, [?])
List of session ids from sys.dm_exec_sessions.
is_user_process [IN | NOT IN] (?, [?])
Is user process from sys.dm_exec_sessions, 0 for system sessions, 1 for user sessions.
database_id [IN | NOT IN] (?, [?])
List of database ids from sys.dm_exec_sessions.
database_name [IN | NOT IN] ('?', ['?'])
List of database names from sys.dm_exec_sessions.
status [IN | NOT IN] ('?', ['?'])
List of requests status from sys.dm_exec_requests.
sql_handle [IN | NOT IN] (?, [?])
List of SQL handles from sys.dm_exec_requests.
plan_handle [IN | NOT IN] (?, [?])
List of Plan handles from sys.dm_exec_requests.
query_hash [IN | NOT IN] (?, [?])
List of query hash from sys.dm_exec_requests.
query_plan_hash [IN | NOT IN] (?, [?])
List of query plan hash from sys.dm_exec_requests.
Additional in / not in options: host_process_id (from sys.dm_exec_sessions), context_info (from sys.dm_exec_sessions),
transaction_isolation_level (from sys.dm_exec_sessions ), group_id (from sys.dm_exec_sessions), node_affinity (from
sys.dm_exec_connections), connection_id (from sys.dm_exec_connections), most_recent_sql_handle (from sys.dm_exec_connections),
request_id (from sys.dm_exec_requests), command (from sys.dm_exec_requests), statement_start_offset (from sys.dm_exec_requests),
statement_end_offset (from sys.dm_exec_requests), blocking_session_id (from sys.dm_exec_requests), transaction_id (from
sys.dm_exec_requests), scheduler_id (from sys.dm_exec_requests), executing_managed_code (from sys.dm_exec_requests).
The following '>' / '<' / '=' range options can be used to filter sessions as shown below:
Example wait > 1000, wait_time < 20000
Example total_elapsed_time > 10000, cpu_time > 1000
wait_time [> | < | =] ?
Wait time from sys.dm_exec_requests.
cpu_time [> | < | =] ?
CPU time from sys.dm_exec_requests.
total_elapsed_time [> | < | =] ?
Total elapsed time (duration) from sys.dm_exec_requests.
reads [> | < | =] ?
Reads from sys.dm_exec_requests.
logical_reads [> | < | =] ?
Logical Reads from sys.dm_exec_requests.
Additional range options: login_time (from sys.dm_exec_sessions), open_transaction_count (from sys.dm_exec_sessions),
num_reads (from sys.dm_exec_connections), num_writes (from sys.dm_exec_connections), writes (from sys.dm_exec_requests),
row_count (from sys.dm_exec_requests), nest_level (from sys.dm_exec_requests), granted_query_memory (from sys.dm_exec_requests).
The following 'like' / 'not like' options can be used to filter sessions as shown below:
Example wait_type LIKE 'LCK%'
Example program_name LIKE 'SQLTest%', wait_type NOT LIKE 'ASYNC_NETWORK_IO'
host_name [LIKE | NOT LIKE ] '?'
Host Name from sys.dm_exec_sessions.
program_name [LIKE | NOT LIKE ] '?'
Program Name from sys.dm_exec_sessions.
login_name [LIKE | NOT LIKE ] '?'
Login Name from sys.dm_exec_sessions.
wait_type [LIKE | NOT LIKE ] '?'
Wait type from sys.dm_exec_requests.
wait_resource [LIKE | NOT LIKE ] '?'
Wait resource from sys.dm_exec_requests.
Additional like / not like options: nt_domain (from sys.dm_exec_sessions), nt_user_name (from sys.dm_exec_sessions),
[@columns =] 'option[, option]' | 'column[, column]' | NULL
Example login_name, CPU, WAIT, DETAILED
Example r.cpu_time r.total_elapsed_time, wait_type, wait_time
The following options are a comma separated list, can be used to choose output columns as shown below:
LIMITED
Outputs a small set of columns.
DEFAULT
Outputs medium set of columns.
NULL
Outputs medium set of columns.
DETAILED
Outputs large set of columns when specified alone otherwise outputs large set of column associated to options chosen.
ALL
Outputs all columns, it is recommended to avoid 'ALL' option, to reduce execution time and storage overhead.
CPU | CPU_DETAILED | PROCESSOR | PROCESSOR_DETAILED
Outputs CPU related columns.
IO | IO_DETAILED | DISK | DISK_DETAILED | STORAGE | STORAGE_DETAILED
Outputs IO related columns.
MEMORY | MEMORY_DETAILED
Outputs memory related columns.
NETWORK | NETWORK_DETAILED
Outputs network related columns.
WAIT | WAIT_DETAILED | WAITS | WAITS_DETAILED
Outputs wait related columns.
BLOCK | BLOCK_DETAILED | BLOCKED | BLOCKED_DETAILED | BLOCKING | BLOCKING_DETAILED
Outputs blocking related columns.
LOCK | LOCK_DETAILED | LOCKS | LOCKS_DETAILED
Outputs lock related columns for blocked and blocking sessions.
ALLLOCKS | ALLLOCKS_DETAILED
Outputs lock related columns for all sessions.
TRAN | TRAN_DETAILED | TRANS | TRANS_DETAILED | TRANSACTION | TRANSACTION_DETAILED | TRANSACTIONS | TRANSACTIONS_DETAILED
Outputs transaction related columns.
SQL | SQL_DETAILED
Outputs sql text related columns.
SQLASTEXT
Outputs selected SQL text columns as text instead of XML. Without this option
selected SQL text columns are output as XML, non-printable characters are replaced with [nchar(?)]
PLAN | PLAN_DETAILED | PLANS | PLANS_DETAILED
Outputs execution plan related columns.
QUERY_PROFILES | QUERY_PROFILES_DETAILED | QUERY_PROFILE | QUERY_PROFILE_DETAILED
Outputs query profile related columns.
STATS | STATS_DETAILED | STATISTICS | STATISTICS_DETAILED
Outputs query, procedure and trigger statistics related columns.
TEMPDB | TEMPDB_DETAILED
Outputs tempdb related columns.
CURSOR | CURSOR_DETAILED | CURSORS | CURSORS_DETAILED
Outputs cursor related columns.
TASK | TASK_DETAILED | TASKS | TASKS_DETAILED
Outputs task related columns.
WORKER | WORKER_DETAILED | WORKERS | WORKERS_DETAILED
Outputs worker related columns.
THREAD | THREAD_DETAILED | THREADS,THREADS_DETAILED
Outputs thread related columns.
SESSION | SESSION_DETAILED | SESSIONS | SESSIONS_DETAILED
Outputs session related columns.
CONNECTION | CONNECTION_DETAILED | CONNECTIONS | CONNECTIONS_DETAILED
Outputs connection related columns.
REQUEST | REQUEST_DETAILED | REQUESTS | REQUESTS_DETAILED
Outputs request related columns.
PLAN_ATTRIBUTE | PLAN_ATTRIBUTE_DETAILED | PLAN_ATTRIBUTES | PLAN_ATTRIBUTES_DETAILED
Outputs plan attribute related columns.
CUSTOM | CUSTOM_DETAILED
Outputs custom columns, contact Ramesh Meyyappan at mailto:rmeyyappan@sqlworkshops.com for details.
input_buffer
Outputs input buffer for requests from sys.dm_exec_requests based on session_id and request_id,
for sessions from sys.dm_exec_sessions based on session_id.
s.input_buffer
Outputs input buffer for sessions from sys.dm_exec_sessions based on session_id.
r.input_buffer
Outputs input buffer for requests from sys.dm_exec_requests based on session_id and request_id.
text_object_name
Outputs object name for requests from sys.dm_exec_query_text based on sys.dm_exec_requests's sql_handle,
for connections from sys.dm_exec_query_text based on sys.dm_exec_connections's most_recent_sql_handle.
text
Outputs text for requests from sys.dm_exec_query_text based on sys.dm_exec_requests's sql_handle,
for connections from sys.dm_exec_query_text based on sys.dm_exec_connections's most_recent_sql_handle.
c.text_object_name
Outputs object name for connections from sys.dm_exec_query_text based on sys.dm_exec_connections's most_recent_sql_handle.
c.text
Outputs text for connections from sys.dm_exec_query_text based on sys.dm_exec_connections's most_recent_sql_handle.
r.text_object_name
Outputs object name for requests from sys.dm_exec_query_text based on sys.dm_exec_requests's sql_handle.
r.text
Outputs text for requests from sys.dm_exec_query_text based on sys.dm_exec_requests's sql_handle.
statement_object_name, r.statement_object_name
Outputs object name from sys.dm_exec_query_text based on sys.dm_exec_requests's sql_handle.
statement, r.statement
Outputs statement, substring of text, for requests from sys.dm_exec_query_text based on sys.dm_exec_requests's sql_handle,
statement_start_offset and statement_end_offset.
query_plan, r.query_plan
Outputs query plan for requests from sys.dm_exec_query_plan based on sys.dm_exec_requests's plan_handle.
query_plan_checksum, r.query_plan_checksum
Outputs query plan checksum, based on query plan, used while saving to avoid duplicate entries.
text_query_plan, r.text_query_plan
Outputs text query plan as xml for requests from sys.dm_exec_text_query_plan based on sys.dm_exec_requests's plan_handle,
statement_start_offset and statement_end_offset.
text_query_plan_as_text, r.text_query_plan_as_text
Outputs text query plan as text for requests from sys.dm_exec_text_query_plan based on sys.dm_exec_requests's plan_handle,
statement_start_offset and statement_end_offset. To avoid error 6335, XML datatype instance has too many levels of nested nodes.
Maximum allowed depth is 128 levels.
full_text_query_plan, r.full_text_query_plan
Outputs complete text query plan as xml for requests from sys.dm_exec_text_query_plan based on sys.dm_exec_requests's plan_handle
with statement_start_offset as 0 and statement_end_offset -1.
full_text_query_plan_as_text, r.full_text_query_plan_as_text
Outputs complete text query plan as text for requests from sys.dm_exec_text_query_plan based on sys.dm_exec_requests's plan_handle
with statement_start_offset as 0 and statement_end_offset -1. To avoid error 6335, XML datatype instance has too many levels of nested nodes.
Maximum allowed depth is 128 levels.
plan_attributes_info, r.plan_attributes_info
Outputs plan attributes for requests from sys.dm_exec_query_plan based on sys.dm_exec_requests's plan_handle.
ctime, s.ctime, c.ctime, r.ctime
Outputs collection time, available with 'SAVE' option or when @datetime is not NULL.
servername, s.servername, c.servername, r.servername
Outputs server name where data was collected, available with 'SAVE' option or when @datetime is not NULL.
The following columns are a comma separated list, can be used to choose output columns:
session_id, login_time, host_name, program_name, host_process_id, client_version, client_interface_name, security_id, login_name, nt_domain, nt_user_name, status, context_info, cpu_time, memory_usage, total_scheduled_time, total_elapsed_time, endpoint_id, last_request_start_time, last_request_end_time, reads, writes, logical_reads, is_user_process, text_size, language, date_format, date_first, quoted_identifier, arithabort, ansi_null_dflt_on, ansi_defaults, ansi_warnings, ansi_padding, ansi_nulls, concat_null_yields_null, transaction_isolation_level, lock_timeout, deadlock_priority, row_count, prev_error, original_security_id, original_login_name, last_successful_logon, last_unsuccessful_logon, unsuccessful_logons, group_id, database_id, authenticating_database_id, open_transaction_count, session_id, most_recent_session_id, connect_time, net_transport, protocol_type, protocol_version, endpoint_id, encrypt_option, auth_scheme, node_affinity, num_reads, num_writes, last_read, last_write, net_packet_size, client_net_address, client_tcp_port, local_net_address, local_tcp_port, connection_id, parent_connection_id, most_recent_sql_handle, session_id, request_id, start_time, status, command, sql_handle, statement_start_offset, statement_end_offset, plan_handle, database_id, user_id, connection_id, blocking_session_id, wait_type, wait_time, last_wait_type, wait_resource, open_transaction_count, open_resultset_count, transaction_id, context_info, percent_complete, estimated_completion_time, cpu_time, total_elapsed_time, scheduler_id, task_address, reads, writes, logical_reads, text_size, language, date_format, date_first, quoted_identifier, arithabort, ansi_null_dflt_on, ansi_defaults, ansi_warnings, ansi_padding, ansi_nulls, concat_null_yields_null, transaction_isolation_level, lock_timeout, deadlock_priority, row_count, prev_error, nest_level, granted_query_memory, executing_managed_code, group_id, query_hash, query_plan_hash, statement_sql_handle, statement_context_id, session_id, job_info, is_blocker, is_head_blocker, blocked_session_ids, input_buffer_checksum, input_buffer_valid_flag, lock_count, lock_owner_id, locks_info, transaction_begin_time, transaction_log_record_count, transaction_log_bytes_used, transaction_info, session_tempdb_usage_kb, session_max_tempdb_usage_kb, session_tempdb_usage_info, cursor_count, max_cursor_dormant_duration, cursors_info, waiting_tasks_wait_types, waiting_tasks_max_wait_duration_ms, waiting_tasks_blocking_session_ids, waiting_tasks_valid_flag, waiting_tasks_info, service_broker_info, custom_info, session_id, connection_id, query_stats_info, procedure_stats_info, trigger_stats_info, session_id, request_id, connection_id, is_blocked, is_dead_locked, blocker_session_ids, head_blocker_session_ids, input_buffer_checksum, input_buffer_valid_flag, wait_resource_info, lock_count, lock_owner_id, locks_info, transaction_begin_time, transaction_info, task_tempdb_usage_kb, task_max_tempdb_usage_kb, task_tempdb_usage_info, query_memory_grants_requested_memory_kb, query_memory_grants_granted_memory_kb, query_memory_grants_used_memory_kb, query_memory_grants_max_used_memory_kb, query_memory_grants_wait_time_ms, query_memory_grants_ideal_memory_kb, query_memory_grants_info, query_profiles_cpu_time_ms, query_profiles_logical_read_count, query_profiles_physical_read_count, query_profiles_read_ahead_count, query_profiles_write_page_count, query_profiles_info, query_stats_info, procedure_stats_info, trigger_stats_info, cached_plans_info, tasks_count, tasks_context_switches, tasks_pending_io, tasks_io_size_kb, read_bytes_per_second, tasks_ios_per_second, tasks_info, workers_info, threads_info, query_plan_text_checksum, custom_info
s.session_id, s.login_time, s.host_name, s.program_name, s.host_process_id, s.client_version, s.client_interface_name, s.security_id, s.login_name, s.nt_domain, s.nt_user_name, s.status, s.context_info, s.cpu_time, s.memory_usage, s.total_scheduled_time, s.total_elapsed_time, s.endpoint_id, s.last_request_start_time, s.last_request_end_time, s.reads, s.writes, s.logical_reads, s.is_user_process, s.text_size, s.language, s.date_format, s.date_first, s.quoted_identifier, s.arithabort, s.ansi_null_dflt_on, s.ansi_defaults, s.ansi_warnings, s.ansi_padding, s.ansi_nulls, s.concat_null_yields_null, s.transaction_isolation_level, s.lock_timeout, s.deadlock_priority, s.row_count, s.prev_error, s.original_security_id, s.original_login_name, s.last_successful_logon, s.last_unsuccessful_logon, s.unsuccessful_logons, s.group_id, s.database_id, s.authenticating_database_id, s.open_transaction_count
c.session_id, c.most_recent_session_id, c.connect_time, c.net_transport, c.protocol_type, c.protocol_version, c.endpoint_id, c.encrypt_option, c.auth_scheme, c.node_affinity, c.num_reads, c.num_writes, c.last_read, c.last_write, c.net_packet_size, c.client_net_address, c.client_tcp_port, c.local_net_address, c.local_tcp_port, c.connection_id, c.parent_connection_id, c.most_recent_sql_handle
r.session_id, r.request_id, r.start_time, r.status, r.command, r.sql_handle, r.statement_start_offset, r.statement_end_offset, r.plan_handle, r.database_id, r.user_id, r.connection_id, r.blocking_session_id, r.wait_type, r.wait_time, r.last_wait_type, r.wait_resource, r.open_transaction_count, r.open_resultset_count, r.transaction_id, r.context_info, r.percent_complete, r.estimated_completion_time, r.cpu_time, r.total_elapsed_time, r.scheduler_id, r.task_address, r.reads, r.writes, r.logical_reads, r.text_size, r.language, r.date_format, r.date_first, r.quoted_identifier, r.arithabort, r.ansi_null_dflt_on, r.ansi_defaults, r.ansi_warnings, r.ansi_padding, r.ansi_nulls, r.concat_null_yields_null, r.transaction_isolation_level, r.lock_timeout, r.deadlock_priority, r.row_count, r.prev_error, r.nest_level, r.granted_query_memory, r.executing_managed_code, r.group_id, r.query_hash, r.query_plan_hash, r.statement_sql_handle, r.statement_context_id
s.job_info, s.is_blocker, s.is_head_blocker, s.blocked_session_ids, s.input_buffer_checksum, s.input_buffer_valid_flag, s.lock_count, s.lock_owner_id, s.locks_info, s.transaction_begin_time, s.transaction_log_record_count, s.transaction_log_bytes_used, s.transaction_info, s.session_tempdb_usage_kb, s.session_max_tempdb_usage_kb, s.session_tempdb_usage_info, s.cursor_count, s.max_cursor_dormant_duration, s.cursors_info, s.waiting_tasks_wait_types, s.waiting_tasks_max_wait_duration_ms, s.waiting_tasks_blocking_session_ids, s.waiting_tasks_valid_flag, s.waiting_tasks_info, s.service_broker_info, s.custom_info
c.query_stats_info, c.procedure_stats_info, c.trigger_stats_info
r.is_blocked, r.is_dead_locked, r.blocker_session_ids, r.head_blocker_session_ids, r.input_buffer_checksum, r.input_buffer_valid_flag, r.wait_resource_info, r.lock_count, r.lock_owner_id, r.locks_info, r.transaction_begin_time, r.transaction_info, r.task_tempdb_usage_kb, r.task_max_tempdb_usage_kb, r.task_tempdb_usage_info, r.query_memory_grants_requested_memory_kb, r.query_memory_grants_granted_memory_kb, r.query_memory_grants_used_memory_kb, r.query_memory_grants_max_used_memory_kb, r.query_memory_grants_wait_time_ms, r.query_memory_grants_ideal_memory_kb, r.query_memory_grants_info, r.query_profiles_cpu_time_ms, r.query_profiles_logical_read_count, r.query_profiles_physical_read_count, r.query_profiles_read_ahead_count, r.query_profiles_write_page_count, r.query_profiles_info, r.query_stats_info, r.procedure_stats_info, r.trigger_stats_info, r.cached_plans_info, r.tasks_count, r.tasks_context_switches, r.tasks_pending_io, r.tasks_io_size_kb, r.read_bytes_per_second, r.tasks_ios_per_second, r.tasks_info, r.workers_info, r.threads_info, r.query_plan_text_checksum, r.custom_info
[@order_by =] 'column[, column]' | 'help' | NULL
When NULL, if @sessions parameter includes 'SAVE' option, ordered by s.ctime, s.session_id else ordered by s.session_id.
When 'help', outputs source select statement to help choose column aliases for use in order by.
When not NULL, ordered by column(s) specified
Comma separated list of column aliases, column[, column].
Can contain any column aliases that are present in select clause, expressions are not allowed to prevent SQL Injection attacks.
Example r.cpu_time desc
Example s.login_name
Example rs.database_id
Example rs.database_name, s.login_name
[@save_to_database =] 'database_name' | NULL
Can be used to save and retrieve data from a specific database:
When NULL, saved in current database.
When not NULL, saved or retrieve from specified database
Example @save_to_database = 'sp_whopro_db'
[@datetime = OUTPUT] 'ctime' | NULL
When NULL and @sessions parameter includes 'SAVE' option, outputs ctime, the collection time.
When not NULL, returns previously saved data where ctime = @datetime
Example @datetime = 2014-12-02 09:00:00.000
Returns previously saved data where ctime = 2014-12-02 09:00:00.000.
Can be combined with @columns parameter to choose columns displayed.
When @sessions parameter includes 'NOOUTPUT' option, outputs the select statement instead of the rseults.
[@datetime_to =] 'ctime' | NULL
When not NULL, returns previously saved data where ctime between @datetime and @datetime_to
Example @datetime_to = 2014-12-04 12:00:00.000
Returns previously saved data where ctime between 2014-12-02 09:00:00.000 and 2014-12-04 12:00:00.000.
[@execution_time_report_threshold =] milliseconds | NULL
When not NULL, prints sp_whopro internal statements that exceeds the @execution_time_report_threshold value,
this is to trace long executing sp_whopro internal queries
When NULL, @execution_time_report_threshold is 250 milliseconds
Example @execution_time_report_threshold = 100
Prints sp_whopro internal statements that exceeds 100 milliseconds execution time.
--Example parameters to monitor waits, blocking and corresponding locks:
exec sp_whopro 'active, blocking', 'sql, wait, block, locks, limited'
go
--Example parameters to monitor waits, blocking and corresponding locks and to save the data to current database:
exec sp_whopro 'active, blocking, save', 'sql, wait, block, locks, limited'
go
--Example parameters to monitor waits, blocking and corresponding locks and to save the data to 'sp_whopro_db' database in a SQL Agent job without output:
exec sp_whopro 'active, blocking, save, nooutput', 'sql, wait, block, locks, limited', null, 'sp_whopro_db'
go
--Example parameters to retrieve saved data from 'sp_whopro_db' database:
exec sp_whopro null, 'sql, wait, block, locks, limited', null, 'sp_whopro_db', '2014-10-16 08:24:13.270','2014-10-18 08:24:13.270'
--Example parameters to output the select statement used to retrieve saved data from 'sp_whopro_db' database:
exec sp_whopro 'nooutput', 'sql, wait, block, locks, limited', null, 'sp_whopro_db', '2014-10-16 08:24:13.270','2014-10-18 08:24:13.270'
go
*/
SQL Server Consulting Services | SQL Server Workshops | Feedback | Subscribe to our Newsletter