x

Why we have to use SWITCH in table partitioning???

Hi dudes, i'm the fresher on SQL. and I've to know what is the importants of SWITCH in table partitioning.??? I've created one table partition month-wise. totally 12 partitions i made it.
ranges are

'2012-01-31 23:59:59.000',
'2012-02-29 23:59:59.000',
'2012-03-31 23:59:59.000',
'2012-04-30 23:59:59.000',
'2012-05-31 23:59:59.000',
'2012-06-30 23:59:59.000',
'2012-07-31 23:59:59.000',
'2012-08-31 23:59:59.000',
'2012-09-30 23:59:59.000',
'2012-10-31 23:59:59.000',
'2012-11-30 23:59:59.000',
'2012-12-31 23:59:59.000'

Thanks in advance !!!

more ▼

asked Sep 03 '12 at 09:53 AM in Default

sabari gravatar image

sabari
40 5 7 9

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

Switching partitions in and out is used for loading and archiving your data. Instead of making INSERTs and DELETEs in your working table (which might be a very busy table), you can load data for a month into a staging table, switch out the oldest partition to an archive table and switch your staging table in.

If you want to go from basics to specifics regarding partitioning and partition switching, I'd recommend reading Kimberly Tripp's MSDN article Partitioned Tables and Indexes in SQL Server 2005

It's written in January 2005, but is still valid.

more ▼

answered Sep 03 '12 at 12:06 PM

Magnus Ahlkvist gravatar image

Magnus Ahlkvist
15.9k 15 19 32

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x1936
x1816

asked: Sep 03 '12 at 09:53 AM

Seen: 700 times

Last Updated: Sep 03 '12 at 12:06 PM