all groups > sql server dts > march 2004 >
You're in the

sql server dts

group:

Just asking for your opinion on executing SP from SQL task vs. NOT


Just asking for your opinion on executing SP from SQL task vs. NOT Just ask for your opinion on executing SP from SQL task
3/5/2004 10:00:31 AM
sql server dts: Which one is best practice?

To use a Execute SQL Task to called a Stored Procedure? OR
Write the sql code in the Execute SQL Task itself?

Thanks in advance for your help. Olivia
Re: Just asking for your opinion on executing SP from SQL task vs. NOT Ray Higdon
3/6/2004 12:33:15 PM
Depends on what you are doing, if you can benefit from a cached optimization
plan then you might use an SP. Also, if you are going to be reusing this
code it might be better to do in an SP so you don't have to correct multiple
places instead of one. SP's are not always the answer as a bad optimization
plan will hurt you more than recompiling or having no cached optimization
plan. You can always create a stored proc with the "with recompile" feature
to not retain a cached plan

HTH

--
Ray Higdon MCSE, MCDBA, CCNA
---
"Just ask for your opinion on executing SP from SQL task"
[quoted text, click to view]

AddThis Social Bookmark Button