Results 1 to 8 of 8

Thread: user tracking..

  1. #1
    Join Date
    Apr 2003
    Posts
    176

    Unanswered: user tracking..

    I have a table in my database and it holds some important information,I want to track the users
    who are executing DML commands(select,update,delete) on the data in that table.
    Is there any way do that?If so how could i implement that.can any one help me in this regard?
    Thanks in advance...

  2. #2
    Join Date
    Sep 2003
    Location
    Dallas, Texas
    Posts
    311

    Re: user tracking..

    Create a trigger to track those activities of that table.

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Look up the use of Niladic functions in Books Online. They can be placed in a trigger to update a column in your table indicating who last modified the record.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    ...also, you can use them at the start of all your stored procedure to save execution information in a log table, such as who called the procedure, when it was called, and what parameters were passed.

    You are making sure all your users can only access the database through stored procedures, right?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  5. #5
    Join Date
    Apr 2003
    Posts
    176
    can u please give me an example that how can I write a trigger to implement this.

    Thanks.

  6. #6
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Do you have Books Online?

    Look up CREATE TRIGGER

    Also what is your security model?

    How do the users connect?

    I'd say your best bet is to start a trace in profiler...

    It'll be less work than having to create triggers (however I have triggers that track all changes to all data and save it to historical tables)

    What are you trying to do and for how long?

    Do you want to audit the data? Do you want to back in time and say how many time did sally blow away the table?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  7. #7
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    The triggers are good for monitoring data modication, but to monitor and log select statements you will need to use either SQL Profiler or log statements at the start of your procedures.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  8. #8
    Join Date
    Sep 2003
    Posts
    522
    check into entegra by lumigent

Posting Permissions

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