Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SP_EXECUTESQL or EXEC(@SQL)

Status
Not open for further replies.
Mar 29, 2004
120
US
Hi,

Is there any PERFORMANCE benifit in SP_EXECUTESQL vs.
EXEC(@SQL)? I know SP_EXECUTESQL allows you to pass params, but as far as recompiles/performance are they different?

Thank you
 
BOL said:
Using sp_executesql is recommended over using the EXECUTE statement to execute a string. Not only does the support for parameter substitution make sp_executesql more versatile than EXECUTE, it also makes sp_executesql more efficient because it generates execution plans that are more likely to be reused by SQL Server.


Questions about posting. See faq183-874
Click here to learn Ways to help with Tsunami Relief
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top