connection to a database

  • Guys,

    Is there a way I can determine who is connected to a particular database. I have an access frontend and SQL Server backend scenario, and I would like to be able to check who is connected to the backend database at any given time. So is there a way I can achieve this? Thanks in advance

  • Have you tried sp_who or sp_who2?

     

     

  • Yes I have even with 'active'

  • What's wrong with the results?

  • nothing, i just thought maybe i can have a sp to run that can generate this for me anytime i want

  • Why can't you just rerun that sp when needed? You can insert the results in a temp table, then do all the count(*) you need to log the information.

  • yep thats what i've decided to do. thanks for your help

  • HTH.

  • You have two other options.

    1) run profiler and capture the results to a table.  issue here is that you can not append the data.  So you need two tables. one that you copy the dialy capture into and one for daily capture/

    2) You can copy sp_who2 into another sp and then schedule it to run every five minutes or so.  What the modified sp would do is output toa table.  --- I use this method to capture database usage across various applications and such.

     

    JerseyMo

  • thanks guys, all sorted with a clever vb script. thanks

Viewing 10 posts - 1 through 9 (of 9 total)

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