November 25, 2014 at 12:30 pm
All,
We have dozens of stored procs with sp_executesql inside the procs. When I run an analysis to determine long-running queries, these are acting as if they are ad-hoc. Is this normal behavior?
Thanks
November 25, 2014 at 2:10 pm
JoshDBGuy (11/25/2014)
All,We have dozens of stored procs with sp_executesql inside the procs. When I run an analysis to determine long-running queries, these are acting as if they are ad-hoc. Is this normal behavior?
Thanks
The first question I would ask is why do you have dozens or procs with dynamic sql? Dynamic sql should be really limited and only used when absolutely necessary.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
November 25, 2014 at 2:28 pm
Inherited, and I would like to change these.
November 25, 2014 at 2:54 pm
When I run an analysis to determine long-running queries, these are acting as if they are ad-hoc. Is this normal behavior?
What are you using for this analysis and what do you mean they are acting like ad-hoc queries?
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
November 25, 2014 at 9:17 pm
JoshDBGuy (11/25/2014)
All,We have dozens of stored procs with sp_executesql inside the procs. When I run an analysis to determine long-running queries, these are acting as if they are ad-hoc. Is this normal behavior?
Thanks
Can we see one of the queries, please? Thanks.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply