In SQL Server 2008 R2, how would I determine what partition a record currently lives in?
Tell me more
×
Database Administrators Stack Exchange is a question and answer site for
database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.
|
When you can identify a row or set of rows already in the table, you can do it like this:
If you have just a value, and it's not necessarily in the table yet, you can tell what partition it would be in given the current state using
(This is also useful shorthand if you are identifying the row(s) in the table using the same column.) |
|||||||||||||||
|
|
You can use the $PARTITION function to achieve this. The link below should help you: |
||||
|
|