The duration value in the sql server profiler trace shows a value larger for a query, than when I run the same query and take a look at the duration of execution for the query. Why is it so, or any other thing that I am missing out on?
how larger? you know that in profiler the duration is stored in microseconds, right? So 1000000 means 1 second.
Besides that, you need to take into considerations other things like reuse of execution plan or even the fact that SSMS is an UI tool and may be doing something else with your query before sending it to the database, and profiler gets the statistics directly from the execution on the DB, which can explain a few seconds more on the execution
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With