Solved

Table Partition switch in and out

Posted on 2013-11-18
2
386 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 500 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
In this article I will describe the Copy Database Wizard 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.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

717 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