I'm a beginner in SQL.
I'd like to know what is the importance of SWITCH
in table partitioning?
I've created one table partitioned month-wise, with a total of 12 partitions.
The ranges are:
'2012-01-31 23:59:59.000',
'2012-02-29 23:59:59.000',
'2012-03-31 23:59:59.000',
'2012-04-30 23:59:59.000',
'2012-05-31 23:59:59.000',
'2012-06-30 23:59:59.000',
'2012-07-31 23:59:59.000',
'2012-08-31 23:59:59.000',
'2012-09-30 23:59:59.000',
'2012-10-31 23:59:59.000',
'2012-11-30 23:59:59.000',
'2012-12-31 23:59:59.000'
'2012-01-31 23:59:59:500'
will unexpectedly land in the wrong partition. Using lower boundaries will also avoid painful coding when creating new boundaries in a sliding window scenario.datetime2
.