Jobs Management and Performance- embed TSQL or call Stored Procedure??

  • Hi,

    What is better: to embed your TSQL code directly within a job step (the command window) or to have the job step call a stored procedure ie: exec usp_sendmail (from the command window)? Is there any job performance or management issues/differences?

    THanks. Jeff

    Many thanks. Jeff

  • Depends on a variety of factors. First of all, how big is the query. For a big query, maintenance would be much easier if it is a SP than in the job step as TSQL. Also, it depends on who is the owner of the job step and what rights the owner has. Performance wise, a SP is going to be faster than a plain query but that needs to be factored into what you are doing and does the difference in performance matters to you. Performance difference might be negligible in some cases.

    Give me a fish, you feed me for a day! Teach me to fish, you feed me for a life time.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply