When you work on a SQL file in SSMS, then SSMS is opening a sql-connection, and during the time that you work on that SQL-file, no matter how many times you execute statements, it always uses the same connection - never closes it.
Now I'm writing a web-interface, basically a SSMS replacement, because that thing is horribly slow.
Now if I want to replicate this functionaliy, I can put the connection into a static ConcurrentDictionary, which I can access from a cookie/parameter, that's not a problem.
I was wondering WHY does SSMS choose to do it this way ?
Why does it not just close&reopen the connection ?
I don't think performance can be the reason there, so - is there any ?
The only reason I can think of is that this way you can work with temporary tables and don't have to use global-temporary tables.
This might be useful if you need to analyze data, where queries are slow.
But I don't think this can be the reason - one could just use global temp-tables instead...
Are there any GOOD reasons to do the connection-handling this way ?