Quantcast
Channel: Sqljunkieshare » sqlserver
Viewing all articles
Browse latest Browse all 5

System Functions – $partition

$
0
0

Returns the partition number into which a set of partitioning column values would be mapped for any specified partition function.

Syntax

[ database_name. ] $PARTITION.partition_function_name(expression)

It returns a Partition number of column value when mapped to a partition function

this will be useful if you want find the rows in a particular partition

so lets explain this with a simple example

 

create partition function

 

 

 

 

 

 

 

 

 

 

 

now lets create a partitioned table

 

 

 

 

 

insert some sample data

now lets see some examples on $partition function



Viewing all articles
Browse latest Browse all 5

Trending Articles