Murach's SQL Server 2005 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 20 How to code CLR stored procedures, functions, and triggers
How to work with CLR stored procedures 606
How to use the SqlTypes namespace to map data types 606
How to declare a stored proecedure 608
How to create a connection 610
How to use the SqlPipe object to return data 610
How to use output parameters to return data 612
How to return an integer value 614
How to raise an error 614
A stored proecedure that manages insert operations 616
A script that calls the stored proecedure 622
How to work with CLR functions 624
How to declare a function 624
How to work with the SqlFunction attribute 626
A scalar-valued function that returns an amount due 628
A table-valued function thtat returns a table with two columns 630
How to work with CLR triggers 632
How to declare a trigger 632
How to work with the SqlTrigger attribute 634
A trigger that updates a column 636
How to use the SqlTriggerContext object 638
A trigger that works with DDL statements 640
Perspective 642
t




Murach's SQL Server 2005

Learn more about this book

View the table of contents

Add this book to your cart



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.