SQL 2014 Developer, Part 5 of 13: Common Language Runtime
Interactive

SQL 2014 Developer, Part 5 of 13: Common Language Runtime

Biz Library
Updated Feb 04, 2020

In this course you’ll learn how to write various kinds of code modules using C# code. You’ll learn the details of creating SQLCLR code manually as well as with Visual Studio. You’ll learn about the Sql data types and how using them can avoid data conversion issues. Most of the code you write will use basic ADO.NET for data access, but there is a special context connection you need to make to the database where the code is executing. I’ll take a close look at creating triggers and user-defined functions, then will explore the security issues of running SQLCLR code in the SQL Server process, and how to make it work. The course wraps up with some recommendations about how to decide whether to use T-SQL or SQLCLR code to create different kinds of code modules.


Lesson 1:

  • Introduction to SQLCLR
  • Role of SQL Server
  • Role of CLR
  • Ways to Use SQLCLR
  • Demo: Enabling SQL CLR.

Lesson 2:

  • Demo: Writing SQLCLR Code
  • Demo: Compiling SQLCLR Code
  • Demo: Loading SQLCLR Assembly
  • Demo: Creating a Function
  • SQLCLR Using Visual Studio
  • Demo: Database Project Template
  • Demo: Creating SQLCLR File
  • Demo: Building and Publishing
  • Demo: Solution Explorer Files
  • Demo: Server Explorer.

Lesson 3:

  • SQL Data Types
  • Data Type Mapping
  • Accessing Local Data
  • Connection String
  • Returning Results
  • Demo: Stored Procedure
  • Demo: Now Using SQLCLR Code
  • Demo: Executing SQLCLR Code
  • Demo: Realistic SQLCLR Example.

Lesson 4:

  • Triggers
  • Demo: SQLCLR Trigger
  • Demo: Testing the Trigger
  • User-Defined Functions
  • Demo: User-Defined Function.

Lesson 5:

  • Demo: External Resources
  • Code Access Security
  • How Access Security Works
  • SQLCLR Permission Sets
  • Demo: Changing Permission Set
  • Demo: Executing External Code
  • T-SQL vs .NET Code
  • Deciding: SQLCLR or T-SQL?.