현재 접근 유저세션, 인증타입을 보기 쉬운 쿼리입니다. 평소에 필요할때마다 만들어 쓰긴 했지만 알아보기 쉽게 만들어져 있네요
SELECT 'Authentication Method'=(
CASE
WHEN nt_user_name IS not null THEN 'Windows Authentication'
ELSE 'SQL Authentication'
END),
login_name AS 'Login Name', ISNULL(nt_user_name,'-') AS 'Windows Login Name',
COUNT(session_id) AS 'Session Count'
FROM sys.dm_exec_sessions
GROUP BY login_name,nt_user_name
having (ISNULL(nt_user_name,'-') not in ('시작계정','SYSTEM')) AND login_name <> '관리자계정'

댓글목록
등록된 댓글이 없습니다.