sp_sqlexec VS. exec(@sql)

Results 1 to 2 of 2

Thread: sp_sqlexec VS. exec(@sql)

  1. #1
    Join Date
    Dec 1969

    Default sp_sqlexec VS. exec(@sql)

    Is there any reason why one should use "EXEC sp_sqlexec @sql" instead of EXEC(@sql)?<BR><BR>EXEC(&#039;SELECT * FROM LOGIN&#039;)<BR>EXEC sp_sqlexec &#039;SELECT * FROM LOGIN&#039;

  2. #2
    Join Date
    Dec 1969

    Default RE: sp_sqlexec VS. exec(@sql)

    I believe the second one can work with parameters. When the parameters change it still can reuse the stored execution plan. So with parameters the second one could be slightly faster.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts