Appendix A. Companion to CLR Routines

This book has common language routine (CLR) code scattered in multiple chapters. CLR routine code for functions, stored procedures, and triggers appears in three chapters (Chapter 6, Chapter 7, and Chapter 8). For your convenience and for reference purposes, I centralized all routine code from the three chapters into this appendix.

CLR User-Defined Types (UDTs) are covered in Chapter 1. The CLR code coverage there is already centralized and independent, so I didn’t see any value in providing it in this appendix as well. Note that CLR User-Defined Aggregates (UDAs) are discussed in my recent book Inside Microsoft SQL Server 2005: T-SQL Querying (Microsoft Press, 2006) and not in this book.

You will also be provided with step-by-step instructions on how to develop and deploy the solutions in both C# and Microsoft Visual Basic.

This appendix provides the following sections, which contain the steps suggested for developing, deploying, and testing your .NET routines’ code:

  • Create a test database in SQL Server 2005 called CLRUtilities.

  • Develop .NET code in Microsoft Visual Studio 2005.

    • Create a project.

    • Develop a class.

  • Deploy the solution either automatically in Visual Studio or manually in SQL Server.

  • Test the code in SQL Server.

For your reference, the step-by-step instructions will be followed by listings that contain the complete CLR-related .NET and T-SQL code that appears in the three chapters.

For a better learning experience, you might find it convenient to first follow all steps described in this appendix to create all routines that are included in the book. Then, as you read a chapter, you won’t have to follow the same steps repeatedly to add each routine. Rather, you can focus on the code snippets provided inline in the chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.79.84