paul s-306273 (1/18/2013)
In my naivete I'm thinking 'so what?'.
Is there a relevance to this?
That's what I though as well when answering the question.
The question itself doesn't appear to make sense to me, but maybe that's because I am not a native English speaker?
It mentions "rows affected in
the estimated execution plan - but there are no rows in the estimated plan (it's XML).
I figured that the author meant "how many rows are affected by the following code when you request an estimated execution plan". But that is nonsense as well, because an estimated plan is made by compiling, but not running the code. So no rows can be affected by definition.
If you have SSMS set to return number of rows affected (yes, that is a changeable option!), then you will indeed get the message "1 row(s) affected". That is because a resultset of 1 row is returned from the server to SSMS. That result set contains the XML column holding the execution plan. You always get this "1 row(s) selected" message when requesting an estimated execution plan, it has nothing to do with the code you wrote. (Except when there are parse errors -in that case, you never get to the compilation stage- or multiple batches -in that case, you get one such message for each batch-)
But again - back to Paul Knibb's reaction: what is the relevance of this?
Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis