Which five Transact-SQL segments should you use to deve…

DRAG DROP
You are the database administrator for a Microsoft SQL Server instance. You develop an Extended Events
package to look for events related to application performance.
You need to change the event session to include SQL Server errors that are greater than error severity 15.
Which five Transact-SQL segments should you use to develop the solution? To answer, move the appropriate
Transact-SQL segments from the list of Transact-SQL segments to the answer area and arrange them in the
correct order.
Select and Place:

DRAG DROP
You are the database administrator for a Microsoft SQL Server instance. You develop an Extended Events
package to look for events related to application performance.
You need to change the event session to include SQL Server errors that are greater than error severity 15.
Which five Transact-SQL segments should you use to develop the solution? To answer, move the appropriate
Transact-SQL segments from the list of Transact-SQL segments to the answer area and arrange them in the
correct order.
Select and Place:

Answer:

Explanation:
Step 1: ALTER EVENT SESSION Contoso1 ON SERVER
Step 2: ADD EVENT …
Step 3: (ACTION …
Step 4: WHERE…
Step 5: ) GO
Example: To start an Extended Events sessions in order to trap SQL Server errors with severity greater than
10,just run the following script:
CREATE EVENT SESSION [error_trap] ON SERVER
ADD EVENT sqlserver.error_reported
(
ACTION
(package0.collect_system_time,package0.last_error,sqlserver.client_app_name,sqlserver.client_hostname,sqls
erver.database_id,sqlserver.database_name,sqlserver.nt_username,
sqlserver.plan_handle,sqlserver.query_hash,sqlserver.session_id,sqlserver.sql_text,sqlserver.tsql_frame,sqlserver.tsql_stack,sqlserver.username)
WHERE ([severity]>10)
)
ADD TARGET package0.event_file
(
SET filename=N’D:\\Program Files\\Microsoft SQL Server\\MSSQL11.MSSQLSERVER\\MSSQL\\XEvents
\\error_trap.xel’
)
WITH
(
STARTUP_STATE=OFF
)
GO
http://sqlblog.com/blogs/davide_mauri/archive/2013/03/17/trapping-sql-server-errors-with-extendedevents.aspx



Leave a Reply 0

Your email address will not be published. Required fields are marked *