I am trying to create an extended event to capture the login information of my server. While creating an extended event on SQL 2008 using the below query
CREATE EVENT SESSION [SA_Monitor] ON SERVER
ADD EVENT sqlserver.login(
ACTION(sqlserver.server_principal_name,sqlserver.sql_text,sqlserver.username)
I am getting the following error.
The event name, "sqlserver.login", is invalid, or the object could not
be found.
On Initial investigation I found that creating extended events using SSMS was introduced from 2012 and the only method to create EE is through SQL query. Is there a generic query that can help me capture this information in the 2008 server.
Best Answer
You can use a logon trigger to record the event info.