How Can I Find Database A Connection is Made to

  • Hi Folks

    can someone tell me how I can find out what database is being connected to by a client or clients ?

    i only know the client IP/Server name

    i would like to know what databses(s) these connections are logging into

    thaks

    jim

  • From SSMS, run sp_who2. This will show all connections to the SQL instance, which DB they are connected to, the host ID, application name, and all other connection related information.

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • Excellent John

    thanks very much

    jim

  • Hi John

    forgot to ask

    by any chance, do you know what tables that is pulling the info from ?

    thanks

    jim

  • Go to the Master database, under Programmability>>System Stored Procedures and find sys.sp_who2. You can review the code.

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • Thanks John

    will do

    Jim

Viewing 6 posts - 1 through 5 (of 5 total)

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