Click here to Skip to main content
15,885,216 members
Articles / Database Development / SQL Server / SQL Server 2008
Tip/Trick

How to Partition Table in SQL Server

Rate me:
Please Sign up or sign in to vote.
2.67/5 (5 votes)
31 Jul 2014CPOL1 min read 26.9K   3   16
How to Partition Table in SQL

I got inspired to write this article becuase of such nice feature of SQL Server improved 80% speed to application response.

Problem: I was trying to retrive 1,000+ of customers from 4,00,000 which nearly taking 2 minutes with Indexed created and Optimisez SQL statement. After implementation of partitioning it was just 15 seconds response time.

Partition feature depends on your database scheme and use. I was retriving customers based on DealerCode so I have created the Parition by Dealers. In the example below I am taking Date as example.

Procedure: 

1: Right click on the table and in the context menu select Storage >> Create Partition.

2: Select table column to parition (E.g. DealerID, Year, CountryID)

3: Give the name of the partition function 

 4:Provide the name of the partition scheme and press next.

5:

Left boundary

The Boundary column label in the grid will dynamically display <= Boundary when you select Left boundary.

Right boundary Select to include range values up to the specified value in the Boundary column for each filegroup selected. The specified value will be the starting value for the range values of the filegroup on the next row. The Boundary column label in the grid will dynamically display < Boundary when you select Right boundary.

Select the starting and ending date and select the Date Range from Monthly, Yearly, Quarterly, Half-Yearly , Daily and press OK.

 

Thats It.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead
India India
Having 9 years of professional software development experience in analysis, design, development, testing and implementation of enterprise web applications for automobile, Digital Marketing, Telecommunication domain with good exposure to object-oriented design, software architectures, design patterns, test-driven development and agile practices.

Area of Working : Dedicated to Microsoft .NET Technologies
Proficient in: C# , ASP.net, SQL

Software Development

Database: Microsoft SQL Server,
Development Frameworks: Microsoft .NET 1.1, 2.0, 3.5, 4.0
UI: Windows Forms, ASP.NET Web Forms and ASP.NET MVC3, JQuery
Coding: WinForm , Web Development, XHTML, XML, HTML5, Javascript, WCF

Achievements:
First prize in National Level Project competition in Academic
Winner in Dotnet contest by Microsoft
Winner in Dotnet contest by Techgig
Winner in SQL Server Solution contest by Microsoft

Comments and Discussions

 
GeneralMy vote of 1 Pin
Ravi Makhija P16-Dec-14 23:28
Ravi Makhija P16-Dec-14 23:28 
insufficient information.
GeneralMy vote of 1 Pin
Member 109815274-Aug-14 3:09
Member 109815274-Aug-14 3:09 
GeneralMy vote of 2 Pin
bobfox1-Aug-14 8:09
professionalbobfox1-Aug-14 8:09 
GeneralRe: My vote of 2 Pin
Member 108828261-Aug-14 11:51
Member 108828261-Aug-14 11:51 
GeneralRe: My vote of 2 Pin
Kale Yogesh6-Aug-14 2:07
Kale Yogesh6-Aug-14 2:07 
QuestionClarification Pin
coded0071-Aug-14 3:16
professionalcoded0071-Aug-14 3:16 
AnswerRe: Clarification Pin
Kale Yogesh17-Feb-15 1:09
Kale Yogesh17-Feb-15 1:09 
QuestionQuerying Pin
Eric Castellon31-Jul-14 3:02
Eric Castellon31-Jul-14 3:02 
AnswerRe: Querying Pin
Kale Yogesh6-Aug-14 2:19
Kale Yogesh6-Aug-14 2:19 
GeneralPLAGIARIZED PinPopular
Dave Kreskowiak26-Mar-11 6:16
mveDave Kreskowiak26-Mar-11 6:16 
GeneralRe: PLAGIARIZED Pin
Trollslayer26-Mar-11 7:38
mentorTrollslayer26-Mar-11 7:38 
GeneralRe: PLAGIARIZED Pin
Wendelius26-Mar-11 7:58
mentorWendelius26-Mar-11 7:58 
GeneralRe: PLAGIARIZED Pin
Hans Dietrich26-Mar-11 10:01
mentorHans Dietrich26-Mar-11 10:01 
GeneralRe: PLAGIARIZED Pin
Dave Kreskowiak26-Mar-11 12:11
mveDave Kreskowiak26-Mar-11 12:11 
GeneralLittle more explanations Pin
Wendelius26-Mar-11 4:13
mentorWendelius26-Mar-11 4:13 
GeneralMore like a Tip/Trick Pin
Henry Minute26-Mar-11 3:39
Henry Minute26-Mar-11 3:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.