Readme_PartitioningScript 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 purpose of the PartitioningScript sample is to demonstrate the table and index partitioning capabilities of SQL Server. For information about this feature, see "Partitioned Tables and Indexes" in SQL Server Books Online.

Important:
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 should not be connected to or used with your production SQL Server database without the permission of the system administrator.



Scenario

In the AdventureWorks sample database, the TransactionHistory table is used to record each sales order, purchase order, and work order transaction. Therefore, this table is one of the largest and most heavily accessed tables in the database. The TransactionHistoryArchive table was created to store older transactions from the TransactionHistory table. Data is transferred to TransactionHistoryArchive on a monthly basis for additional analysis enabling TransactionHistory to stay reasonably small and maintain current data only.
To create the partitions for these tables, the sample performs these operations:

Languages

Transact-SQL

Prerequisites

Before you run this sample, perform the following tasks:

Running the Sample

The following procedure shows how to run the PartitioningScript sample.
To run the PartitioningScript sample
  1. In SQL Server Management Studio, open the file PartitionAW.sql. The default installation directory is C:\Program Files\Microsoft SQL Server\100\Samples\Engine\\Administration\Partitioning\Scripts. Click Execute. © 2008 Microsoft Corporation. All rights reserved.