26 Haziran 2011 Pazar

SQL Server'da Oturum Açan Kullanıcılara Ait Bilgiler

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