Home > Mobile >  Why is @@rowcount equal to 1 when run in complete isolation?
Why is @@rowcount equal to 1 when run in complete isolation?

Time:11-06

According to the Microsoft enter image description here

Reading further into this (enter image description here

I'm curious to understand please why @@rowcount equals 1 when no other statements are used? Is it because the actual SELECT @@ROWCOUNT statement itself causes an update of @@rowcount?

CodePudding user response:

When running SSMS on windows, I indeed get OP's behaviour. By both doing an inputbuffer check and by using the profiler, it seems that when you open a new query window, ssms performs the following batch:

select @@spid;
select SERVERPROPERTY('ProductLevel');

This results in that default ace.

  • Related