This project is read-only.

Readme_Time Series Sample

11/05/2008 21:36:06

This sample works only with SQL Server 2005 and SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2005.
The Time Series sample for SQL Server showcases the integration of CLR into SQL Server. The sample highlights the benefits of this integration in terms of:
  • CLR being a better programming model, offering constructs and capabilities previously not available to SQL Server developers.
  • Streamlined development through a standardized environment, the Visual Studio development environment.
  • Potential for improved performance and scalability. This sample is not supported on IA64.

When you compile SQLCLR samples, the path of the version of the Microsoft .NET Framework compiler that was distributed with SQL Server must be the first Framework directory in the PATH environment variable. The location of the compiler that is included with SQL Server will be either drive:\WINNT\Microsoft.NET\Framework\v2.0.xxxxx or drive:\Windows\Microsoft.NET\Framework\v2.0.xxxxx, where drive is the installation drive and xxxxx is the version number of the .NET Framework that was included with SQL Server.

The default installation directory is C:\Program Files\Microsoft SQL Server\100\Samples\Engine\Programmability\CLR\ TimeSeries.
SQL Server samples and sample databases must be downloaded and installed before you can view or work with them. For more information, see Considerations for Installing SQL Server Samples and Sample Databases.


An analyst want to examine the historical stock market data to identify the trend represented by the sequence of observations and make some future prediction based on the data.


Visual C#.


The Time Series sample uses the following features of SQL Server:

Application Area Features
Overall CLR stored procedures; CLR table-valued functions; CLR scalar-valued functions.LR stored procedures; calling Transact-SQL stored procedures from CLR stored procedures; the VARBINARY(MAX) data type.

Sample Overview

The sample consists of the following:
  • Time Series Library: The Time Series Library contains a set of routines that are used in general time series analysis. These routines are implemented as stored procedures and functions both in Transact-SQL and CLR. The Transact-SQL implementation of Time Series Library is not a complete substitute for the CLR implementation but is a good subset of its CLR counterpart. Refer to <ApplicationFolder>\Library\Readme.htm file to get started with CLR implementation of Time Series Library. Refer to <ApplicationFolder>\TimeSeriesTSQL\Readme.htm_ to get started with Transact-SQL implementation of Time Series Library.
  • Personal Stock Planner: PersonalStockPlanner is an excel-based application that invokes the library routines. Please follow the <ApplicationFolder>\PersonalStockPlanner\Readme.htm file for instructions to setup and use the application. We recommend the users to get familiar with the Time Series Library before they start using PersonalStockPlanner.


Before running this sample, make sure the following software is installed:
  • SQL Server or SQL Server Express. You can obtain SQL Server Express free of charge from the SQL Server Express Documentation and Samples Web site
  • Microsoft Visual Studio 2005 or later.
  • Microsoft Visual Studio 2005 Tools for the Microsoft Office System
  • Microsoft Office Excel 2003 SP1 or SP2


The CLR for SQL Server or SQL Server Express must be enabled for this sample to work correctly.
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.

See Also

CLR Programmability Samples
Other Resources
Common Language Runtime (CLR) Integration Programming Concepts
Help and Information
  • Getting SQL Server 2008 Assistance* © 2008 Microsoft Corporation. All rights reserved.

Last edited Nov 6, 2008 at 11:28 PM by bonniefe, version 9


No comments yet.