x
login about faq Site discussion (meta-askssc)

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 2 4 7

(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
13.7k 13 17 30

(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.

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



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x1834
x1601

asked: Sep 03 '12 at 09:53 AM

Seen: 290 times

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

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.