April 11, 2008 at 12:19 am
Hi
What is th difference between next queries and sp (EXEC, EXECUTE, sp_executesql)?
Thank you
April 11, 2008 at 1:09 am
EXEC and EXECUTE are identical - one is just shorter than the other. sp_executesql supports parameter substitution and it generates execution plans that SQL Server can more readily reuse than EXEC, which makes it more efficient.
Check out sp_executesql in books online, it gives a good overview there.
April 11, 2008 at 6:10 am
What is th difference between next queries and sp (EXEC, EXECUTE, sp_executesql)?
Okay - the first thing that went thru my head was this (before my AM coffee. It's Friday...its been a long week, at least for me):
SELECT (LEN('EXEC') + LEN('EXECUTE')) - LEN('sp_ExecuteSQL')
so, the answer, as I saw it this morning, is, -2 :w00t:
-- Cory
April 11, 2008 at 6:35 am
SQLZ (4/11/2008)
EXEC and EXECUTE are identical - one is just shorter than the other. sp_executesql supports parameter substitution and it generates execution plans that SQL Server can more readily reuse than EXEC, which makes it more efficient.Check out sp_executesql in books online, it gives a good overview there.
EXEC and EXECUTE also supports parameters. can you explain detail about sp_executesql . since i have not been used
shamsudheen
April 11, 2008 at 6:41 am
shamshudheen (4/11/2008)
SQLZ (4/11/2008)
EXEC and EXECUTE are identical - one is just shorter than the other. sp_executesql supports parameter substitution and it generates execution plans that SQL Server can more readily reuse than EXEC, which makes it more efficient.Check out sp_executesql in books online, it gives a good overview there.
EXEC and EXECUTE also supports parameters. can you explain detail about sp_executesql . since i have not been used
shamsudheen
Did you check out Books OnLine as the previous post stated?
http://msdn2.microsoft.com/en-us/library/ms188001.aspx
http://technet.microsoft.com/en-us/library/ms175170.aspx
-- Cory
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply