Find out who is connecting to your database – lovely query!

by Xavier Comments: 0

So I needed to figure out which servers are connecting to which databases. That sounds like a complicated thing but it isn’t!

Just run this query (and make sure you have appropriate permissions)

loginame, hostname, program_name, DB_Name(dbid), last_batch
where hostname <> ”
order by last_batch desc