CLR Programmability Samples

SQL Server 2005 includes sample applications, package samples and numerous coding samples that you can use to learn about the common language runtime (CLR) programmability features of SQL Server.

Samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator.

The following table describes the CLR programmability samples.

Name Description

AdventureWorks Cycles CLR Layer

Provides utilities that form an extra layer of functionality on top of the base AdventureWorks sample database.

Supplementary-Aware String Manipulation

Shows the implementation of five supplementary character-aware Transact-SQL string functions that can handle both Unicode and supplementary character strings.

Large Object (LOB) Handling

Demonstrates transferring large binary objects (LOBs) between SQL Server and a file system that can be accessed by the server by using CLR stored procedures

In-Process Data Access Sample

Contains a number of simple functions demonstrating various features of the CLR in-process data access provider.

String Utilities Sample

Contains a streaming table-valued function, written in C# and Visual Basic, that splits a comma-separated string into a table with one column.

UDT Utilities

Contains a number of user-defined data type utility functions.

User-Defined Data Type (UDT) Sample

Shows the creation and use of a simple user-defined data type from both Transact-SQL and a client application using System.Data.SqlClient

UTF8 String User-Defined Data Type (UDT)

Demonstrates the implementation of a user-defined data type that extends the type system of the database to provide storage for UTF8 encoded values.

Calendar-Aware Date/Time UDTs

Defines two user-defined data types (CADatetime and CADate), which provide calendar-aware handling of dates and times.

Result Set Sample

Demonstrates how to use server-side cursors to work around the lack of Multiple Active Result Set (MARS) support for server-side programming.

Array Parameter Sample

Demonstrates how to pass an array of information from a client to a CLR integration stored procedure on the server by using a CLR integration user-defined data type.

Hello World Sample

Demonstrates the basic operations that are involved in creating, deploying, and testing a simple CLR integration-based stored procedure.

Hello World Ready Sample

Demonstrates the basic operations that are involved in creating, deploying, and testing a simple world ready CLR integration-based stored procedure.

Impersonation Sample

Demonstrates how to use impersonation to use the credentials passed from the client to access operating system protected resources, such as files, when you are using integrated security.

Spatial Sample

Demonstrates how you can use CLR integration technology to enhance the basic indexing and query capabilities to support more sophisticated types of data and queries over that data.

Oracle TVF Sample

Demonstrates how to invoke the managed code interface to Oracle to expose the results of any Oracle query as a table-valued function.

Send DataSet Sample

Demonstrates how to return an ADO .NET based DataSet within a server side CLR-based stored procedure as a result set to the client.

System.Transactions Sample

Demonstrates controlling transactions by using the managed APIs located in the System.Transactions namespace.

See Also

Other Resources

Database Engine .NET Framework Programming

Help and Information

Getting SQL Server 2005 Assistance