Late answer, but I recently got an application with poor execution of sp_prepare and sp_execute.
One : answered before
Two : it can be anything, stored procedures, any valid sql query basically.
Three . I was having trouble SQL Server was unable to create good execution plans when the application used sp_prepare. Basically, SQL Server parses the input parameters to create a good execution plan, but with sp_prepare, parameter values ββare not provided, since they are only added when sp_execute is executed. Thus, at the same time, SQL Server applies common costs for different operators and can very well generate a suboptimal plan.
If you look at your reads / cpu usage for your traces, you can determine if your queries are doing poorly or as expected.
Also see http://blogs.infosupport.com/speeding-up-ssis-literally
source share