Differences between SSMS and ado.net: query execution time

Sometimes, in the forums I’m following, I face some questions about different execution times between Sql Server Management Studio and ado.net executions.

Questions like “Why my SSMS queries run so fast and my ado.net queries are so slow?”. This is a scaring behavior that you can verify lots of times. Some application’s logs tell to us a too large timing. When you copy/paste the SQLCommand into a new query window using SSMS (also on the incriminated server) the execution time is very short.

Continue reading “Differences between SSMS and ado.net: query execution time”