Basically I have created a new extended event session, and I want to schedule this to run for a specific time lets say 2:00 AM. Usually I would of written a script to create a trace and then been able to schedule it using SQL Agent as a job, but I'm new to using Extended Events and I would want to know how I can schedule a session to start capturing at a specific time.
Asked
Active
Viewed 1,042 times
1 Answers
2
You can create the session at any moment using CREATE EVENT SESSION: this will only create the session, but won't start it. In your SQL Agent job you can start the session according to your schedule using this simple command:
ALTER EVENT SESSION session_name
ON SERVER
STATE = start;

spaghettidba
- 529
- 7
- 17
-
thank you for the answer i had completely forgotten about this question. – ZeRaTuL_jF Apr 15 '15 at 15:51