SQL Server 2005 is integrated with the Common Language Runtime (CLR), giving the database access to all of the features and benefits of managed code. Developing in C# is a rich, object-oriented environment that allows for faster time to production and more reliable, more scalable code. The code written in C# still works within the confines of Code Access Security (CAS), which provides enhanced security for all managed code executed by SQL Server 2005. In addition to the ability to write stored procedures in C#, the integration of the CLR into SQL Server 2005 also provides you with the ability to write user-defined data types, functions, and aggregates. One of the other benefits of being able to write C# code for SQL Server 2005 is the ability to use the highly productive IDE native to Visual Studio 2005. Finally, the use of C# can potentially provide dramatic performance increases when applied in the appropriate manner. The following sections will show you how all this and more can be accomplished.