Chapter 7

SQL Server CLR Integration

WHAT’S IN THIS CHAPTER

  • How the CLR is Implemented in SQL Server
  • SQLCLR Assembly Creation and Deployment
  • Securing SQLCLR Assemblies
  • Performance

SQL Server developers first saw the integration of the .NET Common Language Runtime (CLR) with the release of SQL Server 2005. Not a whole lot has changed with the release of SQL Server 2008 and 2012. Yet, SQLCLR provides great benefits to developers as well as database administrators, and is worth reviewing.

This chapter does not focus entirely on how to write SQLCLR .NET assemblies, (visit http://technet.microsoft.com/en-us/library/ms131102(SQL.110).aspx for a more in-depth discussion of that) but does provide a few examples on how to create and deploy an assembly. These serve as a nice foundation on which to focus the majority of the chapter, which covers SQLCLR Administration. This chapter focuses on the CLR as a hosted environment in SQL Server and discusses why you would use T-SQL over a SQLCLR solution. This chapter also discusses SQLCLR performance and security because these are critical concepts to consider when deciding to use SQLCLR.

INTRODUCTION TO THE CLR

With the integration of the .NET Framework CLR components in SQL Server, developers have the flexibility to write stored procedures, triggers, user-defined types and functions, and streaming table-valued functions using a variety of .NET Framework languages, the most common being C# and Visual Basic .NET. It’s no secret that this addition ...

Get Professional Microsoft SQL Server 2012 Administration now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.