It is important that code executing in server environments such as SQL Server protect against asynchronous exceptions. Reliability, as discussed here, is not specific to SQL Server but to writing reliable code for any host executing in a .NET Framework version 2.0 environment. However, SQL Server is the first service making extensive use of the new reliability features of version 2.0, so it is used as an example.

Code running in SQL Server must deal with more stringent reliability guidelines than other server environments. This is due to SQL Server’s steady operation at the edge of resource consumption. OutOfMemoryException and ThreadAbortException exceptions are not uncommon in the SQL Server environment. These guidelines in general are focused less on reliability and more on allowing fully trusted managed code to fail gracefully in the face of AppDomain-level recycling, which is the primary way the server maintains consistency and availability.

In This Section

SQL Server Programming and Host Protection Attributes
Describes how the HostProtectionAttribute attribute is used by SQL Server to restrict the execution of managed code.

Reliability Best Practices
Provides guidelines for writing code that meets reliability requirements.

Constrained Execution Regions
Describes the function and behavior of constrained execution regions (CERs).