Chapter 7. Common Language Runtime DMVs
This chapter covers
SQL is great for performing set-based processing, where one or more rows of data are manipulated in accordance with set theory. In the early days, Structured Query Language (SQL) was extended, typically by third parties looking for commercial advantage, to benefit from an increasingly technical environment. These nonstandard, third-party-based SQL extensions were often embedded into a host programming language to enhance its programmability. Extending the reach of SQL has a long history, culminating in the current movement of using the Common Language Runtime (CLR) to extend SQL programmability.
Although this book is primarily about DMVs, I want to stray a little from the CLR-based DMVs initially. I feel that in order for you to understand the CLR-based DMVs, coupled with the fact that many SQL practitioners may not be so familiar with CLR code, it would be best to first provide a background to CLR processing. In addition, in this chapter I’ll create a small SQL CLR class, which will provide regular expression functionality, allowing complex pattern matching to be used within SQL queries. I hope this will offer a gentle introduction to the subject as well as provide a useful piece of functionality.