O'Reilly logo

Microsoft® SQL Server® 2008 Step by Step by Mike Hotek

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Partitioning Tables and Indexes

Creating a partitioned table, index, or indexed view is very similar to creating a non-partitioned table, index, or indexed view. Every object that is created has an ON clause that specifies where the object is stored. However, the ON clause is routinely omitted, causing objects to be created on the default filegroup. Since a partition scheme is just a definition for storage, partitioning a table, index, or indexed view is a very straight forward process.

An example of a partitioned table is as follows:

CREATE TABLE Employee (EmployeeID         int         NOT NULL,
                        FirstName         varchar(50) NOT NULL,
                        LastName          varchar(50) NOT NULL)
ON mypartscheme(EmployeeID);
GO

The key is the ON clause. Instead of specifying a filegroup, you specify ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required