CLR Stored Procedures and Server-Side Data Access

Our previous “quick and dirty” sample looked at CLR stored procedure development, but we need to cover that topic more thoroughly now. We’ve already covered the mechanics of writing and deploying a stored procedure, but let’s back up a bit to try and understand how CLR stored procedures work from a conceptual standpoint.

SQL CLR stored procedure code runs in an instance of the .NET CLR that is hosted by SQL Server itself; it is not called as an external process, as Component Object Model (COM)– based extended stored procedures (XPs) would be. Because SQL CLR code runs in the context of the server, it treats objects in the database as native, local objects, more or less. As such, it must treat the ...

Get Programming Microsoft® SQL Server™ 2008 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.