Professional Documents
Culture Documents
Monitoring SQL Server
Monitoring SQL Server
sys.dm_*
Practice: Viewing Current Activity
Categories
Groups of related events
Events
The occurrence of an action within SQL Server
Columns
The attributes of events
Managed by using column filters
Demonstration: Using SQL Server Profiler
Viewing triggers
SELECT name FROM sys.triggers
SELECT definition FROM sys.sql_modules . . .
Modifying triggers
ALTER TRIGGER CreateTable ON DATABASE FOR
CREATE_TABLE
AS . . .
Deleting triggers
DECLARE @messageTypeName
@cmd nvarchar(1000)
NVARCHAR(256),
DECLARE
@messageBody
@posttimeXML
nvarchar(24)
;RECEIVE@spid
DECLARE TOP(1)nvarchar(6)
@messageTypeName = message_type_name,
SET @messageBody
@cmd = @messagebody.value
= message_body
FROM dbo.NotifyQueue;
('(/EVENT_INSTANCE/TSQLCommand/CommandText)[1]',
'nvarchar(100)')
SET @messagebody.value
IF @@ROWCOUNT = 0
RETURN
('(/EVENT_INSTANCE/PostTime)[1]','nvarchar(24)')
SET @spid = @messagebody.value
('(/EVENT_INSTANCE/SPID)[1]','nvarchar(6)')
How to Manage Event Notifications