Finding which Database is selected.

vishalneeraj-24503
Posted by vishalneeraj-24503 under Sql Server category on | Points: 40 | Views : 316
Below query will show an active DataBase name.
SELECT db_name(dbid) as [DB_Name],
count(dbid) as No_Of_Connections,
loginame as Login_Name
FROM sys.sysprocesses
WHERE dbid > 0
GROUP BY dbid,loginame;

Comments or Responses

Login to post response