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

In chapter 14, you learned how to code stored procedures, functions, and triggers with T-SQL. In this chapter, you'll learn how to code many of the same procedures, functions, and triggers with C# using the CLR integration feature. (By the way, the free download for this book includes the coding examples in Visual Basic as well as C#.)

Chapter 21 How to code CLR stored procedures, functions, and triggers
How to work with CLR stored procedures 676
How to use the SqlTypes namespace to map data types 676
How to declare a stored proecedure 678
How to create a connection 680
How to use the SqlPipe object to return data 680
How to use output parameters to return data 682
How to return an integer value 684
How to raise an error 684
A stored proecedure that manages insert operations 686
A script that calls the stored proecedure 692
How to work with CLR functions 694
How to declare a function 694
How to work with the SqlFunction attribute 696
A scalar-valued function that returns an amount due 698
A table-valued function thtat returns a table with two columns 700
How to work with CLR triggers 702
How to declare a trigger 702
How to work with the SqlTrigger attribute 704
A trigger that updates a column 706
How to use the SqlTriggerContext object 708
A trigger that works with DDL statements 710
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.