||SQL Server Tips by Gama and Naughter
Samples of SPís
This section is a tutorial aimed at explaining how stored procedures
work through practical examples. Each piece of code is followed by a
screenshot, showing the actual output from running the code in Query
The examples are identical or very similar to the ones from the
chapter ďIntroduction to Extended Stored ProceduresĒ with the
evident difference that they are coded in TSQL. The advantages of
having stored procedures (SPís) functionally equivalent to XPís are:
* C++ programmers can learn more about SPís and TSQL by first
understanding XPís because of their familiarity with C++.
* TSQL programmers can learn more about XPís and C++ by relating
the parts of the code of an SP with its equivalent XP.
* Comparing SPís and XPís for performance, development time,
maintenance issues, etc. is essential for understanding the
differences between them.
XPís are not always a better
choice than SPís; for simple tasks they will do as well as XPís but
with less effort and time involved in the development. SPís and XPís
will coexist and work together, like the infantry and artillery from
the army of database tools.
The above book excerpt is from:
Turbocharge Database Performance with C++ External Procedures
Joseph Gama, P. J. Naughter