October 7, 2004 at 6:25 am
Hi All,
Can any one through some light on differences between sp_executesql and Execute methods? How to select which method we need to use and also in performance point of view which one is better and why?
Thanks in advance..
Regards,
Ramesh K
October 7, 2004 at 8:10 am
From BOL
Transact-SQL supports two methods of building SQL statements at run time in Transact-SQL scripts, stored procedures, and triggers:
Gordon Pollokoff
"Wile E. is my reality, Bugs Bunny is my goal" - Chuck Jones
October 7, 2004 at 10:44 pm
Thanks Gordon,
Can you give some info on performance related issues with these two diff types?
-- Ramesh K
October 8, 2004 at 11:01 am
Helo Ramesh K,
sp_executesql give you the opportunity to use parameters. When executing similar satements that are different only on values for those parameter, you can have a performance gain due to execution plan re-use.
Best regards,
Carl
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply