17.05.2019

Nützliche SQL Skripte

Zeige die Menge der Verbindungen pro User
SELECT DB_NAME(dbid) as DBName, COUNT(dbid) as NumberOfConnections, loginame as LoginName FROM sys.sysprocesses WHERE dbid > 0 GROUP BY dbid, loginame;
Wann erfolgte der letzte Login ?
SELECT MAX(login_time) AS [Last Login Time], login_name [Login] FROM sys.dm_exec_sessions GROUP BY login_name;

skripte, t-sql, connection