Readme_Time Series Sample

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.

Note

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.

Scenario

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.

Languages

Visual C#.

Features

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>\TimeSeries_TSQL\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.

Prerequisites

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

Comments

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

Concepts

CLR Programmability Samples

Other Resources

Common Language Runtime (CLR) Integration Programming Concepts

Help and Information

Getting SQL Server 2008 Assistance