SQL Server Performance Forum – Threads Archive
Check UsageThere is anyway to run a query or sp_ that will tell me if somebody is using the database?
when was the last time it was used? thanks
sp_who — will tell you all the process that connected to the server. sp_who2 active will tell you active processes.
SQL doesn’t store information about when was the last time the database is used, in addition to above recommendation you need to deploy third party tools to audit such activities. If not the above would give you current access information. Satya SKJ
This posting is provided â€œAS ISâ€ with no rights for the sake of knowledge sharing.
You can use the QA to apply to check the status of current activities. Check this Query to get the details of process sorted with highly CPU utilization with databases select sp.hostname,sp.cpu,sd.name,sp.waitresource,sp.physical_io, sp.memusage,
from master..sysprocesses sp, master..sysdatabases sd
order by sp.cpu desc Will this help you out? -Johnson
quote:Originally posted by indshri sp_who — will tell you all the process that connected to the server. sp_who2 active will tell you active processes.Not entirely correct. EXEC dbo.sp_who returns all open connections.
EXEC dbo.sp_who2 returns all open connections, but with additional details. EXEC dbo.sp_who ‘Active’ returns only active connections.
EXEC dbo.sp_who2 ‘Active’ returns only active connections, but with additional details.