Murach's SQL Server 2008 for Developers
How to code stored procedures, functions,
and triggers

This chapter shows you how to use Transact-SQL statements to code three types of database objects that store program code within a database for execution by anyone using the database: stored procedures, user-defined functions, and triggers. This includes coverage of the 2008 table type that allows you to pass a table as a parameter to a stored procedure or function.

Chapter 14 How to code stored procedures, functions, and triggers
Procedural programming options in Transact-SQL 428
Scripts 428
Stored procedures, user-defined functions, and triggers 428
How to code stored procedures 430
An introduction to stored procedures 430
How to create a stored procedure 432
How to declare and work with parameters 434
How to call procedures with parameters 436
How to work with return values 438
How to validate data and raise errors 440
A stored procedure that manages insert operations 442
How to pass a table as a parameter 448
How to delete or change a stored procedure 450
How to work with system stored procedures 452
How to code user-defined functions 454
An introduction to user-defined functions 454
How to create a scalar-valued function 456
How to create a simple table-valued function 458
How to create a multi-statement table-valued function 460
How to delete or change a function 462
How to code triggers 464
How to create a trigger 464
How to use AFTER triggers 466
How to use INSTEAD OF triggers 468
How to use triggers to enforce data consistency 470
How to use triggers to work with DDL statements 472
How to delete or change a trigger 474
t




Murach's SQL Server 2008

Learn more about this book

View the table of contents


More about the eBook



Our Ironclad Guarantee

First, try our books for 90 days. Then, if you aren't completely convinced that our books are the best ones you've ever used, you can return them for a full refund...no questions asked.