September 28, 2010 at 3:28 pm
I have some sql statment,which when I run it individually they are pretty fast,but when I put them inside a stored procedure and execute the stored procedure.It is very slow.We are using SQL SERVER 2008.Should I do anything special about the SP?Something like compiling?Because I am running the exact code inside and outside of stored procedure
September 28, 2010 at 3:36 pm
The stored procedure gets compiled at run time (and then cached), the same as running individual statements. There should be no difference in performance between the two, or at least nothing noticeable by a human.
I'd be willing to bet it's something like parallelism kicking in and causing issues, blocking, or some other outside factor.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply