sp_prepare and sp_execute vs sp_executesql

    1. I have noticed sp_executesql also makes a single plan for a stmt with parameter in a loop.
    2. q1) Generally plan is evicted from cache from first in first out or usage basis.so if i use sp_executesql then i should be fine in a loop in stored procedure or from .net or i must use sp_prepare and sp_execute in a loop?

    if sp_executesql does my job then where exactally sp_prepare and sp_execute comes in to picture ( theortically it says sp_executesql only resues the plan it is cache and plan cache evicts unused plan first)

     

Viewing post 1 (of 1 total)

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