Wednesday, March 21, 2012

How to get the count of connection?

Can we use Sql Profile to get the count of connections to SQLServer?This is a multi-part message in MIME format.
--010700040007010304020809
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
No, but you can get that data from System Monitor [perfmon.exe]
(MSSQL:General Statistics | User Connections) or simply by querying the
server. In SQL 2000 you would query the master.dbo.sysprocesses system
table (or better yet execute system procs sp_who or sp_who2) like this:
select * from master.dbo.sysprocesses;
go
exec sp_who;
go
exec sp_who2;
go
In SQL 2005 you would query the sys.dm_exec_sessions or
sys.dm_exec_connections dynamic management views (which gives you
similar info) like this:
select * from sys.dm_exec_sessions;
go
select * from sys.dm_exec_connections;
go
Hope this helps.
--
*mike hodgson*
http://sqlnerd.blogspot.com
ad wrote:
>Can we use Sql Profile to get the count of connections to SQLServer?
>
>
--010700040007010304020809
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>No, but you can get that data from System Monitor [perfmon.exe]
(MSSQL:General Statistics | User Connections) or simply by querying the
server. In SQL 2000 you would query the master.dbo.sysprocesses system
table (or better yet execute system procs sp_who or sp_who2) like this:<br>
</tt>
<blockquote><tt>select * from master.dbo.sysprocesses;</tt><br>
<tt>go</tt><br>
<tt>exec sp_who;</tt><br>
<tt>go</tt><br>
<tt>exec sp_who2;</tt><br>
<tt>go</tt><br>
</blockquote>
<tt>In SQL 2005 you would query the sys.dm_exec_sessions or
sys.dm_exec_connections dynamic management views (which gives you
similar info) like this:<br>
</tt>
<blockquote><tt>select * from sys.dm_exec_sessions;<br>
go</tt><tt><br>
</tt><tt>select * from sys.dm_exec_connections;<br>
go<br>
</tt></blockquote>
<tt><br>
Hope this helps.<br>
</tt>
<div class="moz-signature">
<title></title>
<meta http-equiv="Content-Type" content="text/html; ">
<p><span lang="en-au"><font face="Tahoma" size="2">--<br>
</font></span> <b><span lang="en-au"><font face="Tahoma" size="2">mike
hodgson</font></span></b><span lang="en-au"><br>
<font face="Tahoma" size="2"><a href="http://links.10026.com/?link=http://sqlnerd.blogspot.com</a></font></span>">http://sqlnerd.blogspot.com">http://sqlnerd.blogspot.com</a></font></span>
</p>
</div>
<br>
<br>
ad wrote:
<blockquote cite="miduWZevOvJGHA.2696@.TK2MSFTNGP14.phx.gbl" type="cite">
<pre wrap="">Can we use Sql Profile to get the count of connections to SQLServer?
</pre>
</blockquote>
</body>
</html>
--010700040007010304020809--

No comments:

Post a Comment