Last active
October 4, 2018 21:58
-
-
Save sqldeployhelmet/ed05e351637af9259744eee18d947be2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE [VeryBusyDatabase]; | |
GO | |
CREATE PARTITION FUNCTION [pf_MonthlyWindow] ( DATETIME2(7)) -- This data type must match your partitioning column data type exactly! | |
AS RANGE RIGHT FOR VALUES ( N'1900-01-01T00:00:00.000' | |
, N'2016-08-01T00:00:00.000' | |
, N'2016-09-01T00:00:00.000' | |
, N'2016-10-01T00:00:00.000' | |
, N'2016-11-01T00:00:00.000' | |
, N'2016-12-01T00:00:00.000' | |
, N'2017-01-01T00:00:00.000' | |
, N'2017-02-01T00:00:00.000' | |
, N'2017-03-01T00:00:00.000' | |
, N'2017-04-01T00:00:00.000' | |
, N'2017-05-01T00:00:00.000' | |
, N'2017-06-01T00:00:00.000' | |
, N'2017-07-01T00:00:00.000' | |
, N'2017-08-01T00:00:00.000' | |
, N'2017-09-01T00:00:00.000' | |
, N'2017-10-01T00:00:00.000' | |
, N'2017-11-01T00:00:00.000' | |
, N'2017-12-01T00:00:00.000' | |
, N'2018-01-01T00:00:00.000' | |
, N'2115-01-01T00:00:00.000' ); | |
GO | |
CREATE PARTITION SCHEME [ps_MonthlyWindow] | |
AS PARTITION [pf_MonthlyWindow] | |
TO ( [PRIMARY] | |
, [PRIMARY] | |
, [PRIMARY] | |
, [PRIMARY] | |
, [PRIMARY] | |
, [PRIMARY] | |
, [PRIMARY] | |
, [PRIMARY] | |
, [PRIMARY] | |
, [PRIMARY] | |
, [PRIMARY] | |
, [PRIMARY] | |
, [PRIMARY] | |
, [PRIMARY] | |
, [PRIMARY] | |
, [PRIMARY] | |
, [PRIMARY] | |
, [PRIMARY] | |
, [PRIMARY] | |
, [PRIMARY] | |
, [PRIMARY] ); | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment