Implementing Managed Code

Managed code runs in the .NET CLR. SQL Server 2005 integrates CLR to allow execution of managed code within the SQL Server environment. This provides flexibility in writing the database code in multiple languages supported by .NET. Managed code also takes advantage of the programming languages to implement complex programming logic in database objects, such as stored procedures and triggers. | Implementing Managed Code Managed code runs in the .NET CLR. SQL Server 2005 integrates CLR to allow execution of managed code within the SQL Server environment. This provides flexibility in writing the database code in multiple languages supported by .NET. Managed code also takes advantage of the programming languages to implement complex programming logic in database objects such as stored procedures and triggers. This chapter introduces SQLCLR which is the CLR hosted on the SQL Server. Further it explains how to implement stored procedures user-defined functions triggers and user-defined types by using managed code. Objectives In this chapter you will learn to fl Understand managed code fl Create managed database objects Chapter 9 Understanding Managed Code As a database developer you create database objects such as procedures functions and triggers to implement programming logic by using T-SQL. However in some situations it is not possible to implement the required functionality by using the T-SQL code. For example you need to store the credit card number in a table in an encrypted format so that it cannot be tampered. For this you need to apply various string manipulations and mathematical calculations which involve usage of arrays and constructs. It is very complex to do this using T-SQL code. With CLR integration in SQL Server 2005 you can create programs in any of the .NET-supported languages to implement enhanced programming logic that cannot be implemented by using T-SQL. Code that is written in any of the .NET supported languages and runs in the CLR is called managed code. You can embed these programs in your database so that they can run in the same environment in which the database exists. To implement managed code on the database server it is important for you to know the details of CLR integration with the SQL Server. It is also important to identify situations when it is better to implement the managed code than use T-SQL code. Introduction to SQL .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.