User audit

  • I have my table divided into datetime, eventid, and description.

    Right now I have a query that gives me all the people that logged on from 6:00 am yesterday to 6:00 am the next day (WHERE datetime >= '2008-11-06 06:00:00.000' and eventid = 184)

    The description normally reads Client IP [xxx.xxx.xxx.xxx] with username [username@mydomain.com] connected successfully to server [XXX.XXX.XXX.XXX], using protocol [ICA].

    I'm basically trying to make a query where, anyone in the table users (joe@mydomain.com,etc...), will show up if I run the where query above.... I'm trying to make it so I don't have to look manually at a list and compare it to another! 😀

  • Your post is a bit confusing and doesn't contain all required information. :w00t:

    So here is a guess:

    Are you saying that you have a table [users] and a table [loginHistory], and you want a query that lists all users and any applicable login information for a given day? i.e.:

    UserA {no results because didn't login}

    UserB IP.xxx 9:33:42

    Thanks,

    Clarie

  • Yes, what you described is what I am looking for... 🙂

  • amdavis (11/10/2008)


    Yes, what you described is what I am looking for... 🙂

    It sounds like you need an OUTER JOIN.

    For better answers, please follow the best practices outlined in the following article:

    http://www.sqlservercentral.com/articles/Best+Practices/61537/

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply