Skip to Content
Inside Microsoft® SQL Server™ 2005
book

Inside Microsoft® SQL Server™ 2005

by Itzik Ben-Gan, Lubor Kollar, Dejan Sarka
May 2006
Intermediate to advanced
536 pages
15h 13m
English
Microsoft Press
Content preview from Inside Microsoft® SQL Server™ 2005

sp_executesql

The sp_executesql command was introduced in SQL Server later than the EXEC command, mainly to provide better support for reusing execution plans. In this section, I’ll describe sp_executesql and its enhanced support in SQL Server 2005.

The sp_executesql Interface

The sp_executesql command is more flexible than EXEC(<string>) because it has an interface, which supports both input and output parameters. This capability allows you to create query strings with arguments that can reuse execution plans more efficiently than EXEC. The components of sp_executesql are very similar to those of a stored procedure, with the difference being that you construct the code dynamically. Those components include: a batch of code; parameter declaration ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microsoft® SQL Server® 2008 For Dummies®

Microsoft® SQL Server® 2008 For Dummies®

Mike Chapple
Microsoft® SQL Server® 2008 Bible

Microsoft® SQL Server® 2008 Bible

Paul Nielsen, Mike White, Uttam Parui
A Developer’s Guide to SQL Server 2005

A Developer’s Guide to SQL Server 2005

Bob Beauchemin, Dan Sullivan
Microsoft® SQL Server® 2008 Internals

Microsoft® SQL Server® 2008 Internals

Paul Randal Kalen Delaney Kimberly Tripp, and Conor Cunningham

Publisher Resources

ISBN: 0735621977Supplemental ContentErrata