dbTalk Databases Forums  

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

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Just asking for your opinion on executing SP from SQL task vs. NOT in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Just ask for your opinion on executing SP from SQL task
 
Posts: n/a

Default Just asking for your opinion on executing SP from SQL task vs. NOT - 03-05-2004 , 12:00 PM






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


Reply With Quote
  #2  
Old   
Ray Higdon
 
Posts: n/a

Default Re: Just asking for your opinion on executing SP from SQL task vs. NOT - 03-06-2004 , 11:33 AM






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"
<anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
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




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.