?
Solved

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

Posted on 2010-01-09
5
Medium Priority
?
245 Views
Last Modified: 2012-05-08
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
Comment
Question by:cartch2008
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 5

Accepted Solution

by:
chinawal earned 2000 total points
ID: 26275583
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
 
LVL 5

Expert Comment

by:chinawal
ID: 26275596
0
 

Author Comment

by:cartch2008
ID: 26275673
is there a way to find out queries that were run between a certain time?
0
 
LVL 5

Assisted Solution

by:chinawal
chinawal earned 2000 total points
ID: 26275833
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
 
LVL 5

Expert Comment

by:dbidba
ID: 26276364
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

Quick Start: DOCKER

Sometimes you just need a Quick Start on a topic in order to begin using it.. this is just what you need to know to get up and running with Docker!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question