Friday, March 30, 2012

Restrict number of connections to a databse.

Hi
Is there anyway I can restrict the number of connections to a SQL Server
database ?
How can we do that.?
Also what is the best way to find out number of current connections to the
database using a query ?
Thanksselect @.@.maxconnections
can be set using sp_configure
sp_who and sp_who2 show you the number of connections
--
Dandy Weyn, Belgium
MCSE, MCSA, MCDBA, MCT
http://www.dandyman.net
Check my SQL Server resource pages (currently under construction)
http://www.dandyman.net/sql
"Abraham" <binu_ca@.yahoo.com> wrote in message
news:ODXIsYx#DHA.3500@.tk2msftngp13.phx.gbl...
> Hi
> Is there anyway I can restrict the number of connections to a SQL Server
> database ?
> How can we do that.?
> Also what is the best way to find out number of current connections to the
> database using a query ?
> Thanks
>|||Hi,
Is there anyway I can restrict the number of connections to a SQL Server
database ?
You can restrict the connections only SQL Server wide not database level.
How can we do that.?
SP_configure 'user connections',numberofconnections
(By default it is 0 and allow maximum)
Also what is the best way to find out number of current connections to the
database using a query ?
select substring(db_name(dbid),1,30) as DB_name ,count(*) as Connection
from sysprocesses
group by substring(db_name(dbid),1,30)
Thanks
Hari
MCDBA
"Abraham" <binu_ca@.yahoo.com> wrote in message
news:ODXIsYx#DHA.3500@.tk2msftngp13.phx.gbl...
> Hi
> Is there anyway I can restrict the number of connections to a SQL Server
> database ?
> How can we do that.?
> Also what is the best way to find out number of current connections to the
> database using a query ?
> Thanks
>|||bear in mind that the connections is only configurable at a server level and
not at a database level, thus sp_configure 'show advanced'
,1 must be set inorder to be able to view and set this option.
also to finding the current active connections can be done by using sp_who2
active
this shows you the active users only.
Olu Adedeji
"Abraham" <binu_ca@.yahoo.com> wrote in message
news:ODXIsYx#DHA.3500@.tk2msftngp13.phx.gbl...
> Hi
> Is there anyway I can restrict the number of connections to a SQL Server
> database ?
> How can we do that.?
> Also what is the best way to find out number of current connections to the
> database using a query ?
> Thanks
>

No comments:

Post a Comment