Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8187717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:39:23+00:00 2026-06-07T02:39:23+00:00

I don’t clearly understand the purpose of using $PARTITION in SQL server? I have

  • 0

I don’t clearly understand the purpose of using $PARTITION in SQL server? I have read the content from MSDN but don’t still understand.

What benefit can you use it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T02:39:26+00:00Added an answer on June 7, 2026 at 2:39 am

    Partitioning tables in a database means splitting it into multiple pieces while still treating it like a single table. We are talking here about horizontal partitioning which means that each partition contains all of a columns but only some of the rows. To do this, you have to define a partition function which defines which partition a row belongs to, based on that row’s value in the partitioning column. $PARTITION tells you which partition a row belongs to.

    Let’s say we had an integer column that represented the rating of our rows and we expect that users will often ask only for items rated above 4. We could partition based on rating. Our partition function could be:

    CREATE PARTITION FUNCTION partitionByRating (int) FOR VALUES (4);
    

    Then, to find out which partition the rows of our table belong to, we could query:

    SELECT $partition.partitionByRating(i.Rating) AS [Partition Number],
        rating AS [Rating],
        name AS [Item Name]
    FROM dbo.Items AS i
    

    And we might get a result like:

    Partition    Rating    Item Name
    1            1         Ball
    1            4         Scooter
    2            5         Blaster
    

    Which means that Ball and Scooter will be stored together, but depending on how you assign partitions to storage, Blaster might be stored somewhere else.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Don't ask me how but I'm in a situation where I have DCPs published
Don't know where else to ask, but from one day to the other my
Don't know why this is happening, but after submitting a form via JS (using
Don't ask why but I have the requirement to draw a border around certain
DON'T ASK WHY but... I have a regex that needs to be case insensitive
Don't know why but I can't find a solution to this. I have 3
don't know better title for this, but here's my code. I have class user
I don't know to explain this but here i go, so i have a
don't know if the title describes anything about what I'm trying to say but
Don't really know how to formulate the title, but it should be pretty obvious

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.