• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • Last Modified:

SQL Server - Ability to view Current Connections and Current queries being run

Is there a way to view how many current connections there are to a sql server database.  Also, is there a way to view a log of the recent queries that were run against a database?
0
cartch2008
Asked:
cartch2008
  • 3
2 Solutions
 
chinawalCommented:
Use 'SQL Profiler' to find out what queries are being run on the database.
sp_who or sp_who2 would give you details about connections.
0
 
cartch2008Author Commented:
is there a way to find out queries that were run between a certain time?
0
 
chinawalCommented:
You can use this:
http://www.mssqltips.com/tip.asp?tip=1715

I assume, you know how to schedule a job in SQL Agent. The SQL Profile Trace would start at the scheduled time and will run for the time set within the variable @StopTime.
0
 
dbidbaCommented:
Adam Machanic created a great stored procedure named WhoIsActive for showing what processes are active and what they are doing. It will even give you deltas on the counters. I depend on it every day. Use it all the time.

You may download it here:
http://sqlblog.com/blogs/adam_machanic/archive/2009/03/30/who-is-active-v8-40-now-with-delta-power.aspx
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now