Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 table partitioning

Author  Topic 

sunsanvin
Master Smack Fu Yak Hacker

1274 Posts

Posted - 2008-11-13 : 04:44:28
Dear All,
is it possible to create table partitioning on an existing table? or only possible on a new table?
what are the main advantages of table partitioning in sql server?

thanks in advance

Arnav
Even you learn 1%, Learn it with 100% confidence.

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-11-13 : 05:17:19
you can partition an existing and a a new table.
the main advantage is that a single table can be spread over many file groups/drives so that very large systems can benefit from less IO oer disk.
http://www.databasejournal.com/features/mssql/article.php/3638236/Data-partitioning-in-SQL-Server-2005---Part-I.htm

_______________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.1 out!
Go to Top of Page

cvraghu
Posting Yak Master

187 Posts

Posted - 2008-11-13 : 05:23:10
From BOL -

You can turn an existing nonpartitioned table into a partitioned table in one of two ways.

One way is to create a partitioned clustered index on the table by using the CREATE INDEX statement. This action is similar to creating a clustered index on any table, because SQL Server essentially drops the table and re-creates it in a clustered index format. If the table already has a partitioned clustered index applied to it, you can drop the index and rebuilding it on a partition scheme by using CREATE INDEX with the DROP EXISTING = ON clause.

Another way is to use the Transact-SQL ALTER TABLE SWITCH statement to switch the data of the table to a range-partitioned table that has only one partition. This partitioned table must already exist before the conversion occurs, and its single partition must be empty. For more information about switching partitions, see Transferring Data Efficiently by Using Partition Switching. After the table is modified as a partitioned table, you can modify its partition function to add partitions, as described previously in Modifying a Partition Function.


Advantages -
- Faster and Easier Data Loading
- Faster and Easier Data Deletion or Archival
- Faster Queries

Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-11-13 : 10:34:15
You need to have Clustered index in place for existing tables to participate.
Go to Top of Page
   

- Advertisement -