Results 1 to 4 of 4

Thread: sp_lock and sp_who

  1. #1
    Join Date
    Nov 2002
    Location
    cornwall
    Posts
    187

    sp_lock and sp_who

    Is there any way to write a line to a table showing who had a lock at a particular time?

    We have a need to rollback transactions that persist for too long and cause application errors. what i want to do is to dump the details of the connection into a table for analysis later.

    i am thinking along the lines of
    SELECT loginname
    FROM sp_who
    WHERE spid in
    (
    SELECT spid
    FROM sp_lock
    )
    or something!!!!

    any ideas anyone?

  2. #2
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254

  3. #3
    Join Date
    Nov 2002
    Location
    cornwall
    Posts
    187
    MAK, can you use profiler from within a SQL job and output to a table? I was not aware of this, can you post any sample code please?

  4. #4
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254

Posting Permissions

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