Sunday, March 25, 2012

@@connections increases by 2

Running SQL Server locally for testing purpose
Running select @.@.connections returns 21
Opened a new window in QA
Running select @.@.connections returns 23
I was assuming it to return 22.
Why does it increase it by 2. I have done this many times by opening just
window and nobody else is connected..so why does it increase it by 2 instead
of 1 ?The @.@.connections global variable holds returns the number of connections,
or attempted connections, since SQL ServerT was last started, not the number
of current connections. If you use Profiler, you can trace Query Analyzer -
you can find out that QA makes login, checks some things, makes logout and
then makes login again. This way QA makes 2 connecions for a session.
--
Dejan Sarka, SQL Server MVP
FAQ from Neil & others at: http://www.sqlserverfaq.com
Please reply only to the newsgroups.
PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:OzWDlyzbDHA.2024@.TK2MSFTNGP12.phx.gbl...
> Running SQL Server locally for testing purpose
> Running select @.@.connections returns 21
> Opened a new window in QA
> Running select @.@.connections returns 23
> I was assuming it to return 22.
> Why does it increase it by 2. I have done this many times by opening just
> window and nobody else is connected..so why does it increase it by 2
instead
> of 1 ?
>

No comments:

Post a Comment