Module 10: Implementing Managed Code in the Database

Slides:



Advertisements
Similar presentations
Yukon – What is New Rajesh Gala. Yukon – What is new.NET Framework Programming Data Types Exception Handling Batches Databases Database Engine Administration.
Advertisements

1 Introduction to ASP.Net 4.0 Development David Ringsell MCSD MCT MCPD.
Unit 1: Overview of the Microsoft.NET Platform
1 Unit 1: Introduction To.Net. 2 Introduction to.Net Integrated Development Environment (IDE) Languages in the.NET Framework The Common Language Runtime.
.NET Framework Overview
Using.NET Platform Note: Most of the material of these slides have been taken & extended from Nakov’s excellent overview for.NET framework, MSDN and wikipedia.
Module 17 Tracing Access to SQL Server 2008 R2. Module Overview Capturing Activity using SQL Server Profiler Improving Performance with the Database Engine.
History of.Net Introduced by Microsoft Earlier technology was VC++ and VB VC++ comes with so many library and VB was so easy to use and not flexible to.
.NET Framework Overview Pingping Ma Nov 16 th, 2006.
Introduction to the C# Programming Language for the VB Programmer.
Module 1: Overview of the Microsoft.NET Framework.
Introducing the Common Language Runtime for.NET. The Common Language Runtime The Common Language Runtime (CLR) The Common Language Runtime (CLR) –Execution.
Intro to C# Language Richard Della Tezra IS 373. What Is C#? C# is type-safe object-oriented language Enables developers to build a variety of secure.
Introducing the Common Language Runtime. The Common Language Runtime The Common Language Runtime (CLR) The Common Language Runtime (CLR) –Execution engine.
SQL Server 2005 CLR Integration ADO.NET 2.0 Mike Taulty
Platforms and tools for Web Services and Mobile Applications Introduction to C# Bent Thomsen Aalborg University 3rd and 4th of June 2004.
Intro to dot Net Dr. John Abraham UTPA – Fall 09 CSCI 3327.
Module 15 Configuring and Deploying Windows Client Applications.
1 Introduction to.NET Framework. 2.NETFramework Internet COM+ Orchestration Orchestration Windows.NET Enterprise ServersBuildingBlockServices Visual Studio.NET.
.NET Framework Introduction: Metadata
Introduction to .Net Framework
Programming the CLR in SQL Server 2005 Mark Blomsma Develop-One Session Code: DB.08.
An Introduction To CLR Integration in SQL Server 2005 (Yukon) Dr Greg Low.
Benefits of PL/SQL. 2 home back first prev next last What Will I Learn? In this lesson, you will learn to: –List and explain the benefits of PL/SQL –List.
SQL Server 2005 The Common Language Runtime (CLR) Integration Presented by Tarek Ghazali IT Technical Specialist Microsoft SQL Server MVP Web Development.
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott COMP6325 Advanced Web Technologies Dr. Paul Walcott The University.
Session 1 - Introduction and Data Access Layer
Meir Botner David Ben-David. Project Goal Build a messenger that allows a customer to communicate with a service provider for a fee.
Native Support for Web Services  Native Web services access  Enables cross platform interoperability  Reduces middle-tier dependency (no IIS)  Simplifies.
CIS NET Applications1 Chapter 2 –.NET Component- Oriented Programming Essentials.
.NET Framework & C#.
Appendix D: Microsoft.NET Framework Overview. Overview.NET Framework Architecture.NET Namespaces.
 Internet providing backbone for applications  Use of several web sites and devices to provide one complete solution  Software as services  Quick software.
Lecture Set 1 Part B: Understanding Visual Studio and.NET – Structure and Terminology 1/16/ :04 PM.
CSC 494/594 C# and ASP.NET Programming. C# 2012 C# Object-oriented language with syntax that is similar to Java.
Module 1: Overview of the Microsoft.NET Platform.
CS795/895: Introduction. Topics Distributed Systems –Availability –Performance –Web Services Security –Authentication –Authorization –Confidentiality.
Component-Based Software Engineering Introduction to.NET Paul Krause.
.NET Framework Danish Sami UG Lead.NetFoundry
Module 9 Designing and Implementing Stored Procedures.
Basic Security: Java vs.NET Master Seminar Advanced Software Engineering Topics Prof. Jacques Pasquier-Rocha Software Engineering Group Department of Informatics.
tom perkins1 XML Web Services -.NET FRAMEWORK – Part 1 CHAPTER 1.1 – 1.3.
Module 15 Monitoring SQL Server 2008 R2 with Alerts and Notifications.
Module 1: Getting Started. Introduction to.NET and the.NET Framework Exploring Visual Studio.NET Creating a Windows Application Project Overview Use Visual.
Module 3: Using Microsoft.NET- Based Languages. Overview Overview of the.NET-Based Languages Comparison of the.NET-Based Languages.
Intro to dot Net Dr. John Abraham UTPA CSCI 3327.
Module 11 Authorizing Users to Access Resources. Module Overview Authorizing User Access to Objects Authorizing Users to Execute Code Configuring Permissions.
PRIOR TO WEB SERVICES THE OTHER TECHNOLOGIES ARE:.
Microsoft .NET A platform that can be used for building and running windows and web applications such that the software is platform and device-independent.
Getting Started with.NET Getting Started with.NET/Lesson 1/Slide 1 of 31 Objectives In this lesson, you will learn to: *Identify the components of the.NET.
Common Language Runtime Introduction  The common language runtime is one of the most essential component of the.Net Framework.  It acts.
DEV394.NET Framework: Migrating To Managed Code Adam Nathan QA Lead Richard Lander Program Manager Microsoft Corporation.
Integrating and Extending Workflow 8 AA301 Carl Sykes Ed Heaney.
In this session, you will learn to: Understand managed code Create managed database objects Define the Hypertext Transfer Protocol endpoints Implement.
SQL Server 2005:.NET Framework Programming in the Database Tim Sneath Architectural Engineer, Microsoft
7.5 Using Stored-Procedure and Triggers NAME MATRIC NUM GROUP Muhammad Azwan Bin Khairul Anwar CS2305A Muhammad Faiz Bin Badrol Shah CS2305B.
Just-In-Time Compilation. Introduction Just-in-time compilation (JIT), also known as dynamic translation, is a method to improve the runtime performance.
.Net Online Training. Introduction to.Net Microsoft.NET is a software Framework includes Framework class library and provides language interoperability.
D OTNET ONLINE TRAINING. DOTNET Online Training Course Content : Introduction to.Net Online Training NET FUNDAMENTALS Why Dot Net? The Dot Net initiative.
.NET Framework.
Introducing the Microsoft® .NET Framework
CE-105 Spring 2007 Engr. Faisal ur Rehman
Deploying and Configuring SSIS Packages
2.1. Compilers and Interpreters
.NET and .NET Core 2. .NET Runtimes Pan Wuming 2017.
Module 1: Getting Started
Introduction to C# AKEEL AHMED.
Programming in C# CHAPTER 1
MATERI PL/SQL Procedures Functions Packages Database Triggers
DOT NET ARCHITECTURE (OR) DOT NET FRAME WORK ARCHITECTURE
Presentation transcript:

Module 10: Implementing Managed Code in the Database

Overview Introduction to the SQL Server Common Language Runtime Importing and Configuring Assemblies Creating Managed Database Objects

Lesson 1: Introduction to the SQL Server Common Language Runtime What Is the .NET Common Language Runtime? Advantages of Managed Code SQL Server 2005 CLR Integration Managed Code vs. Transact-SQL

What Is the .NET Common Language Runtime? .NET Framework Class Library Support Thread Support COM Marshaler Type Checker Exception Manager Security Engine Debug Engine MSIL to Native Compilers Code Manager Garbage Collector Class Loader

Advantages of Managed Code Description Programming language Choice of programming language Type safety Type safety through the common type system Security Security through code access security and role-based security Fast development Fast development because of extensive base class library Interoperability Interoperable with unmanaged code

SQL Server 2005 CLR Integration Run managed code within a database by using in-process assemblies Create managed stored procedures, triggers, user-defined functions, user-defined types, and aggregates Integration benefits: Enhanced programming model Enhanced safety and security Common development environment Performance and scalability

Managed Code vs. Transact-SQL Use managed code for: Procedures that feature complex logic Access to the .NET Framework class library CPU-intensive functions Use Transact-SQL for data access with only basic procedural logic

Lesson 2: Importing and Configuring Assemblies What Is an Assembly? Syntax for Importing an Assembly Assembly Trust Levels Demonstration: Importing and Configuring an Assembly

What Is an Assembly? Compiled code containing types, methods, and metadata Unit of deployment for managed code Executes in-process within the SQLCLR DLL .NET Code Compiled Assembly SQLCLR

Syntax for Importing an Assembly Specify a database object name for the assembly Reference the assembly file Set assembly trust level (optional) CREATE ASSEMBLY Contacts FROM 'C:\ContactsApp\Contacts.dll' WITH PERMISSION_SET = SAFE -- default value CREATE ASSEMBLY Contacts FROM 'C:\ContactsApp\Contacts.dll' CREATE ASSEMBLY Contacts

Assembly Trust Levels PERMISSION_SET Description Default setting SAFE Recommended for most scenarios EXTERNAL_ACCESS Access external resources such as files or registry Use only if essential UNSAFE Unrestricted internal and external access Avoid due to potential security risk

Demonstration: Importing and Configuring an Assembly In this demonstration, you will see how to import and configure an assembly

Lesson 3: Creating Managed Database Objects Overview of Managed Database Objects Managed Stored Procedures, Triggers, and Functions Managed Aggregates and User-Defined Types Demonstration: Creating Managed Database Objects

Overview of Managed Database Objects .NET Assembly SQL Server 2005 Namespaces Aggregate Functions User-Defined Types Classes Stored Procedures Triggers Methods User-Defined Functions

Managed Stored Procedures, Triggers, and Functions Use CREATE PROCEDURE, TRIGGER, or FUNCTION Link to the assembly by using EXTERNAL NAME Use the database object as normal CREATE PROCEDURE Person.UpdatePhoneList AS EXTERNAL NAME Contacts.[Contacts.PhoneList].SaveList CREATE PROCEDURE Person.UpdatePhoneList AS Assembly Name Class Name with Namespace Method Name EXEC Person.UpdatePhoneList

Managed Aggregates and User-Defined Types Use CREATE AGGREGATE or TYPE Link to the assembly by using EXTERNAL NAME Use the database object as normal CREATE AGGREGATE Concatenate(@input nvarchar(4000)) RETURNS nvarchar(4000) EXTERNAL NAME Utilities.[Utilities.Concatenate] CREATE AGGREGATE Concatenate(@input nvarchar(4000)) RETURNS nvarchar(4000) SELECT AccountNumber, dbo.Concatenate(SalesOrderNumber) Orders FROM Sales.SalesOrderHeader GROUP BY AccountNumber

Demonstration: Creating Managed Database Objects In this demonstration, you will see how to: Create a managed user-defined function Create a managed user-defined type

Lab: Implementing Managed Code in the Database Exercise 1: Importing an Assembly Exercise 2: Creating Managed Database Objects