Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Tracking user logins to SQL Database Application

Author  Topic 

sqljnp3
Starting Member

2 Posts

Posted - 2011-10-17 : 10:25:05
Hello,

I am new to SQL Server Programming. I am trying to figure out a way to track user logins to a SQL Database Application for a given period. The server is running SQL Server 2005 SP 3 and each user has an account to the application.
Any help would be greatly appreciated.

Thank you.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-17 : 10:40:14
have a look at LOGON triggers

http://msdn.microsoft.com/en-us/library/bb326598(v=SQL.90).aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

paultech
Yak Posting Veteran

79 Posts

Posted - 2011-10-17 : 11:02:01
kindly find the following link


http://blogs.msdn.com/b/sqlprogrammability/archive/2006/08/16/703079.aspx

Go to Top of Page

sqljnp3
Starting Member

2 Posts

Posted - 2011-10-17 : 12:08:12
Thank you both for your quick replies.
Paultech - It looks like I would have to set up Auditing on SQL Server Management Studio before I can specify the "lgnstats_trace" file below.
However, Auditing does seem available on SQL 2005, while it is available on SQL 2008.


-- Find @lastSuccessNew

SELECT TOP(1) @lastSuccessNew = StartTime FROM #lgnstats_trace
WHERE … LoginName = @login AND

EventClass = 14
ORDER BY StartTime DESC
Go to Top of Page
   

- Advertisement -