March 15, 2013 at 2:16 pm
All,
When setting the rowcount in a query in SQL Server Management Studio, the count of databases in the database drop down in SSMS also shrinks to the number in the "SET ROWCOUNT" statement.
For example:
SET ROWCOUNT 0 - Shows all databases
SET ROWCOUNT 2 - Shows ONLY the top 2 database on the server
It also seems that the setting this in the "Tools/Options/Query Execution" has the same behavior.
Is this the desired behavior since the drop down is using the same session as the query or just a bug in SSMS?
Anton
March 15, 2013 at 3:32 pm
Interesting.
SSMS is probably internally running a query / stored proc to get the list of databases. Obviously the "SET ROWCOUNT" is affecting the code it uses as well.
I guess technically that is a bug. Presumably their code could store whatever value you had for SET ROWCOUNT, reset it to 0, run their query, then reset it back to your value.
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
March 15, 2013 at 3:55 pm
I just ran Profiler to see what was happening and as I suspected the operation to get the list of databases is happening on the same SPID as the query window you are in meaning it is also subject to the ROWCOUNT setting. It kind of makes sense to use the same SPID else every query window would actually open two connections to the instance, but this is an odd side-effect.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply