number of connection

K

Konrad

Hi

How can I know how many
connections is estabilished with
database in SQL Server?

Thanks
Konrad
 
W

William Ryan eMVP

Hi Konrad:

You can use @@Connections to determine the number of connections (and
attempts) since the server was last started. Similarly you can use sp_who
and sp_who2 for instance to get the current users (which doesn't necessarily
= number of connections). Not sure if either of these will help but I
figured I'd mention them.

--
W.G. Ryan MVP Windows - Embedded

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups
 
W

William \(Bill\) Vaughn

You can also use PerfMon and look a the SQL Server "General" statistics to
see the number of open connections.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
W

William Ryan eMVP

Thanks for the info. Forgive my cluelessness but is that done through SQLDMO
[perfmonmode] or the DBCC Perfmon? (Actually I should quit being and bum
and check it out in BOL). While I have you - let me ask you one other thing
if you dont' mind. I was looking through the 2.0 libraries and saw the
NumberOfReclaimedConnections counter. Is there a way under the current
versions of ADO.NET that I could tell that I was leaving open connections
that I should be closing? I know that I can preempt this by always using a
'using(SqlConnection cn...) or finally block but if I was looking at a ton
of code that someone else wrote, is there a diagnostic that would tip me off
to this problem?

Thanks again!


Bill

--
W.G. Ryan MVP Windows - Embedded

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups
 
W

William \(Bill\) Vaughn

Perfmon is the application under administrative tools "performance"
VS.net 2003 has perf counter objects that can be programmed to any of these
perf counters.
Not that they work very well, but you can try.
The SQLClient counters are notoriously buggy

--
____________________________________
Bill Vaughn
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
William Ryan eMVP said:
Thanks for the info. Forgive my cluelessness but is that done through
SQLDMO
[perfmonmode] or the DBCC Perfmon? (Actually I should quit being and bum
and check it out in BOL). While I have you - let me ask you one other
thing
if you dont' mind. I was looking through the 2.0 libraries and saw the
NumberOfReclaimedConnections counter. Is there a way under the current
versions of ADO.NET that I could tell that I was leaving open connections
that I should be closing? I know that I can preempt this by always using
a
'using(SqlConnection cn...) or finally block but if I was looking at a ton
of code that someone else wrote, is there a diagnostic that would tip me
off
to this problem?

Thanks again!


Bill

--
W.G. Ryan MVP Windows - Embedded

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups
William (Bill) Vaughn said:
You can also use PerfMon and look a the SQL Server "General" statistics
to
see the number of open connections.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
W

William Ryan eMVP

I'll give it a try right now - Thank You!

--
W.G. Ryan MVP Windows - Embedded

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups
William (Bill) Vaughn said:
Perfmon is the application under administrative tools "performance"
VS.net 2003 has perf counter objects that can be programmed to any of these
perf counters.
Not that they work very well, but you can try.
The SQLClient counters are notoriously buggy

--
____________________________________
Bill Vaughn
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
William Ryan eMVP said:
Thanks for the info. Forgive my cluelessness but is that done through
SQLDMO
[perfmonmode] or the DBCC Perfmon? (Actually I should quit being and bum
and check it out in BOL). While I have you - let me ask you one other
thing
if you dont' mind. I was looking through the 2.0 libraries and saw the
NumberOfReclaimedConnections counter. Is there a way under the current
versions of ADO.NET that I could tell that I was leaving open connections
that I should be closing? I know that I can preempt this by always using
a
'using(SqlConnection cn...) or finally block but if I was looking at a ton
of code that someone else wrote, is there a diagnostic that would tip me
off
to this problem?

Thanks again!


Bill

--
W.G. Ryan MVP Windows - Embedded

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups
William (Bill) Vaughn said:
You can also use PerfMon and look a the SQL Server "General" statistics
to
see the number of open connections.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

Hi Konrad:

You can use @@Connections to determine the number of connections (and
attempts) since the server was last started. Similarly you can use sp_who
and sp_who2 for instance to get the current users (which doesn't
necessarily
= number of connections). Not sure if either of these will help but I
figured I'd mention them.

--
W.G. Ryan MVP Windows - Embedded

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups
Hi

How can I know how many
connections is estabilished with
database in SQL Server?

Thanks
Konrad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top