After catching some data in a SQL Profiler session, I can almost always see a second entry of type
RPC:Completed for each query using a
sp_executesql statement. I know that this is done to create re-usable execution plan by reducing the query with parametrization.
exec sp_executesql N'SELECT s.* FROM s WHERE s.C= @O', @O uniqueidentifier', @O='11112222-4444-3333-1212-5555666677'
SELECT s.* FROM s WHERE s.C= @O
Looking at the total
sum(Duration) of the profiler events, do I have to count both of those? The query was executed once, so 10 ms was the correct result. Instead the total result is 20 ms, with I think is just WRONG and a program-error of Profiler. Do I have to filter one of them away anyhow and how?