Results 1 to 5 of 5

Thread: SQL auditing

  1. #1
    Join Date
    Sep 2010
    Posts
    3

    Unanswered: SQL auditing

    Hello.

    I'm dot.net developer, and i'm working a lot with MSQL. My current task is when some user executes select query on database, i should "catch" the query data. What do i mean is if select query is "select * from UsersTbl where UserID = 5", i have to get '5'. Does somebody have any idea where to start???

    Thanks a lot.

    Dmitry

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    This is an usual requirement - usually people only want to audit changes to data.

    There are only a few options to my knowledge (I don't think SQL 2008 introduced any auditing of this nature).

    If ALL access is via stored procedures then I think this is best logged by the procedure code. If people access the base tables then the only way to log this is using traces, logging the SQL Statement executed. Note that this has quite an overhead, will generate a lot of data and may have an unacceptable impact on the performance of the server if the number of requests is high.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Sep 2010
    Posts
    3
    Thanks pootle flump.
    I mean to be like SQL profiler. Probably I should use CLR integration, some diagnostic class....

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Profiler uses traces - it is simply a GUI for them. I would recommend using server side traces rather than profiler, however you can use profiler if you must. At the very least run it on another machine.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    Sep 2010
    Posts
    3
    Thank you. I will try this way

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •