Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
SoftFox
Starting Member
42 Posts |
Posted - 2008-02-05 : 05:34:56
|
Is there any advantage to using sp_ExecuteSQL instead of just EXEC to execute a SQL string? E.gDECLARE @ExecStr nVARCHAR(300)SET @ExecStr = 'SELECT TOP 10 * FROM LCSearchRequests'--both give same result. Is one better than the other?exec sp_ExecuteSQL @ExecStrexec(@ExecStr) |
|
sunil
Constraint Violating Yak Guru
282 Posts |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-02-05 : 08:24:52
|
A must read articlewww.sommarskog.se/dynamic_sql.htmlMadhivananFailing to plan is Planning to fail |
 |
|
SoftFox
Starting Member
42 Posts |
Posted - 2008-02-06 : 05:36:08
|
OK didnt realise about the ability to pass in parameters in sp_ExecuteSQL. that is quite usefull to know. |
 |
|
|
|
|