SQL Server useful but less known features
-
Checking who is connected to the database
sp_who
sp_who
All it takes is to create the following PowerShell script (text file with .ps1 extension) and changing $server and $db variables to match the server's host and instance name (SERVER\INSTANCE) and a database name.