[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Table Partition switch in and out

Posted on 2013-11-18
2
Medium Priority
?
389 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
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…

649 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