?
Solved

Table Partition switch in and out

Posted on 2013-11-18
2
Medium Priority
?
398 Views
Last Modified: 2014-01-12
Hi Experts,

Could you please help me with a solution for dynamic partitioning in SQL Server including the creation of partition, splitting , Merging , Switching  and archiving to the history table  .

Criteria :
1.maintain 3 months in the current table .
2.older than 3 months , create,split,merge and  switch the partition (partition switch in/switch out)
3. Move to history table older  than 3 months
4. Archive and purge the data older than 5 years

All these steps should be performed dynamically in SQL SERVER.  Please help me with the solution with an example source code. Your help is greatly appreciated.  

Regards,
srk
0
Comment
Question by:n_srikanth4
2 Comments
 
LVL 40

Accepted Solution

by:
lcohan earned 1500 total points
ID: 39657724
There is a good article and 13 SQL script files that you could find by if you do a Google search on any of the names listed below:

1_dbo.fn_GetPartitionRangeValueForPartitionFunctionAndNumber.sql
2_dbo.fn_GetPartitionNumberForPartitionFunctionAndValue.sql
0
 

Author Closing Comment

by:n_srikanth4
ID: 39775352
Sounds good article. I will go through this and come up with questions if any.
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question