17.06.2013 Views

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Summary<br />

Wow! That’s a lot to have to take in for one chapter. Still, this is among the most important chapters in<br />

the book in terms of being able to function as a developer in <strong>SQL</strong> <strong>Server</strong>.<br />

Sprocs are the backbone of code in <strong>SQL</strong> <strong>Server</strong>. We can create reusable code and get improved performance<br />

and flexibility at the same time. We can use a variety of programming constructs that you might be<br />

familiar with from other languages, but sprocs aren’t meant for everything.<br />

Pros to sprocs include:<br />

❑ Usually better performance<br />

❑ Possible use as a security insulation layer (control how a database is accessed and updated)<br />

❑ Reusable code<br />

❑ Compartmentalization of code (can encapsulate business logic)<br />

❑ Flexible execution depending on dynamics established at runtime<br />

Cons to sprocs include:<br />

Chapter 12: Stored Procedures<br />

❑ Not portable across platforms (Oracle, for example, has a completely different kind of implementation<br />

of sprocs)<br />

❑ May get locked into the wrong execution plan in some circumstances (actually hurting<br />

performance)<br />

Sprocs are not the solution to everything, but they are still the cornerstones of <strong>SQL</strong> <strong>Server</strong> programming.<br />

In the next chapter, we’ll take a look at the sprocs’ very closely related cousin — the UDF.<br />

409

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!