Sams Teach Yourself Transact-SQL in 21 Days, Second Edition
by Lowell Mauer, David Solomon, Bennett McEwan
Writing Your First Stored Procedure
This week, we'll look at various approaches to handling orders and the related order details records in the Northwind database. We'll use the Shopping Cart analogy used by most commerce Web sites, in which you can freely add and remove items from your "cart" (that is, your order) until you close the order. We will require five procedures:
Add an item to the cart
Remove an item from the cart
Display the contents of the cart
Cancel the order
Close the order
First, we'll write the first two procedures, and then you will write the next two as part of the exercises at the end of this lesson. We'll write the final procedure in Day 16, "Optimizing Stored Procedures."
In order to use the shopping cart method, we'll ...
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.
Read now
Unlock full access