Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Automated Script to Partition Tables

By Aditya Kota,

 

I work in a very big environment and all of our Fact Tables are partitioned on a day-day basis.

The date partition is from our dimension process. Hence, the fact tables are partitioned on the date dimension.

 

The below script gives you the ease of generating an automatic script which prints the filegroup, file for the partition and also prints the Alter Partiton scheme to use the filegroup and also the splits the partiton function.

 

Our SAN is carved with smaller chunks for optimal performance and i follow a round-robin algorithm while partitoning. So, that is the reason for the drive names are named with Mount points and practically each one used for a specific partition.

 

This gives an ease for extending partitions on a day-day basis.

 

I hope this script will help a lot of folks out there...working in a warehouse!!!

Total article views: 2065 | Views in the last 30 days: 10
 
Related Articles
FORUM

Partition

Partition

FORUM

Partition Info using VB Script

SSIS Package using VB Script task to retreive partition information

SCRIPT

Table Partitioning in SQL Server 2005

Sample script for Table Partition

FORUM
FORUM

Partition

Partition

Tags
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones