yi

     沉睡的字符正在苏醒,0和1正在展示自然的魄力!

导航

查找当前的登录用户

 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

posted on 2010-07-09 22:59  yi  阅读(239)  评论(0编辑  收藏  举报