December 2013
Intermediate to advanced
1872 pages
153h 31m
English
A partition function identifies values within a table that will be compared to the column on which you partition the table. As mentioned previously, it is important that you know the distribution of the data and the specific range of values in the partitioning column before you create the partition function. The following query provides an example of determining the distribution of data values in the SalesOrderDetail table by year:
--Select the distinct yearly valuesSELECT year(modifiedDate) as 'year', count(*) 'rows' FROM [AdventureWorks2012].[Sales].[SalesOrderDetail] GROUP BY year(modifiedDate) ORDER BY 1go year rows----------- ----------- 2005 5151 2006 19353 ...