Question : Audit Logins of SQL Server Management Studio

I need to audit the logins of SQL Server Management Studio itself. I know there is an option to audit logins but that seems to be logging all my application database logins aswell.

Is there a way to audit the logins only when done via SQL Server Management Studio.

Cheers

Answer : Audit Logins of SQL Server Management Studio

You can find some example in BOL: http://technet.microsoft.com/en-us/library/bb326598.aspx.

Also there is an article on simple-talk: http://www.simple-talk.com/sql/sql-server-2005/logon-triggers/.

Be careful when using APP_NAME to detect the program name - SSMS can use multiple names (e.g. "Microsoft SQL Server Management Studio - Query" can be the name for query window while Object Explorer can use another one). You can use Profiler to find out what the program names of all SSMS windows are. Or just use some LIKE logic to find all the patterns matching the template '%Management Studio%'.
Random Solutions  
 
programming4us programming4us