{"id":278,"date":"2019-04-14T18:08:47","date_gmt":"2019-04-14T18:08:47","guid":{"rendered":"https:\/\/datablog.roman-halliday.com\/?p=278"},"modified":"2019-04-14T18:08:47","modified_gmt":"2019-04-14T18:08:47","slug":"partitions-in-sql-server-partition-an-existing-fact-table-by-date","status":"publish","type":"post","link":"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/04\/14\/partitions-in-sql-server-partition-an-existing-fact-table-by-date\/","title":{"rendered":"Partitions in SQL Server: Partition an Existing Fact Table (by date)"},"content":{"rendered":"<p>Picking up on my series on partitioning, previously I looked at\u00a0<a href=\"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/03\/31\/partitions-in-sql-server-creating-a-partitioned-fact-table-by-date\/\">Partitions in SQL Server: Creating a Partitioned Fact Table (by date)<\/a> now I&#8217;m going to look into splitting an existing table into partitions. A key thing to remember is that the moving of data on disk can be time consuming and cause locks.<\/p>\n<p>The approaches to look at are:<\/p>\n<ol>\n<li>Partition the table by applying a function and schema to it.<\/li>\n<li>Create a new table, and shuffle the data into it.<\/li>\n<\/ol>\n<p>Unfortunately, there is no way (that I&#8217;m aware of in present versions of SQL Server) to partition an existing table bit by bit (only shuffle a batch of rows into partitions). Any modification to a partition structure will require all rows to be moved.<\/p>\n<h2>Components of a Partitioned Table<\/h2>\n<ol>\n<li><strong>Partition Function<\/strong>: The definition of how data is to be split. It includes the data type, and the value ranges to use in each partition.<\/li>\n<li><strong>Partition Scheme<\/strong>: The definition of how a <em>partition function<\/em> is to be applied to data files. This allows DBAs to split data across logical storage locations if required, however in most modern environments with large SANs most SQL Server implementations and their DBAs will just use \u2018primary\u2019.<\/li>\n<li><strong>Table &amp; Index Definition<\/strong>: The last part is the definition of the table, including the <em>partition scheme<\/em> to use, and the index with which to apply it.<\/li>\n<\/ol>\n<h1>The Fact Table<\/h1>\n<h2>Sample Table<\/h2>\n<p>I&#8217;ll create a table using some made up data:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">--------------------------------------------------------------------------------\r\n-- Create Date List\r\n--------------------------------------------------------------------------------\r\nDECLARE @DateStart DATE = '01-JAN-17';\r\nDECLARE @DateEnd   DATE = GetDate();\r\nWITH number_tbl AS (\r\nSELECT 0 AS a UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL\r\nSELECT 4      UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL\r\nSELECT 8      UNION ALL SELECT 9\r\n), number_sequences AS (\r\nSELECT (t3.a + (10 * t2.a) + (100 * t1.a)) AS concatenate_calculation\r\n  FROM number_tbl t1\r\n  CROSS JOIN number_tbl t2\r\n  CROSS JOIN number_tbl t3\r\n), date_sequence AS (\r\nSELECT CAST(DateAdd(DAY, concatenate_calculation, @DateStart) AS DATE) AS [TheDate]\r\n  FROM number_sequences\r\n WHERE CAST(DateAdd(DAY, concatenate_calculation, @DateStart) AS DATE) &lt;= @DateEnd\r\n)\r\nSELECT [TheDate]\r\n  INTO #DateList\r\n  FROM date_sequence\r\n ORDER BY [TheDate]\r\n;\r\nCREATE UNIQUE CLUSTERED\r\n INDEX PK_DateList\r\n    ON #DateList\r\n      ([TheDate])\r\n;\r\n--------------------------------------------------------------------------------\r\n-- Create Dummy Fact table (we will keep coming back to this)\r\n-- Using cartesian join, giving 4 rows for each date\r\n--------------------------------------------------------------------------------\r\nWITH s_data AS (\r\nSELECT 'Data 1' AS [c_attribute], 100 AS [c_metric] UNION ALL\r\nSELECT 'Data 2' AS [c_attribute], 200 AS [c_metric] UNION ALL\r\nSELECT 'Data 3' AS [c_attribute], 300 AS [c_metric] UNION ALL\r\nSELECT 'Data 4' AS [c_attribute], 400 AS [c_metric]\r\n)\r\nSELECT [TheDate],\r\n       [c_attribute],\r\n       [c_metric]\r\n  INTO #FactTable\r\n  FROM #DateList,\r\n       s_data\r\n;\r\nCREATE CLUSTERED\r\n INDEX SK_DateList\r\n    ON #FactTable\r\n      ([TheDate])\r\n;\r\n<\/pre>\n<p>Now I&#8217;ll combine the sample data (multiple times) into a fact table:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">--------------------------------------------------------------------------------\r\n-- Create Fact Table (without partitions)\r\n--------------------------------------------------------------------------------\r\nCREATE TABLE [dbo].[FactTable_unpartitioned]\r\n(\r\n    [Date]      DATE,\r\n    [attribute] VARCHAR(100),\r\n    [metric]    BIGINT\r\n);\r\n\r\nCREATE CLUSTERED\r\nINDEX [PK_FactTable_unpartitioned]\r\n    ON [dbo].[FactTable_unpartitioned]\r\n      ([Date], [c_attribute])\r\n;\r\n\r\nINSERT\r\n  INTO [dbo].[FactTable_unpartitioned]\r\nSELECT *\r\n  FROM #FactTable\r\n;\r\n\r\n-- Create more rows\r\nDECLARE @START_INT BIGINT = 6;\r\nDECLARE @END_INT   BIGINT = 0;\r\n\r\nWHILE @START_INT &gt; @END_INT\r\nBEGIN\r\n    INSERT\r\n      INTO [dbo].[FactTable_unpartitioned]\r\n    SELECT *\r\n      FROM [dbo].[FactTable_unpartitioned]\r\n    ;\r\n    SET @START_INT = @START_INT - 1;\r\nEND;<\/pre>\n<h1>Creating The Partitioned Table<\/h1>\n<h2>Partition Function<\/h2>\n<p>For this dataset, I\u2019m going to add a new partition for each month (functions can be for any time frame you chose):<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">--------------------------------------------------------------------------------\r\n-- Partition Function\r\n-- Using RIGHT (so the value given is the LOWER value)\r\n--------------------------------------------------------------------------------\r\nCREATE PARTITION FUNCTION [FactTable_PF]\r\n      (DATE) -- Datatype to use\r\nAS\r\nRANGE RIGHT  -- See previous post\r\n FOR VALUES  -- Values on which to 'split' the data\r\n(\r\n    N'2017-01-01T00:00:00', -- This will contain all data for 2017 Jan onwards (until the next partition). All data before then goes into a 'catch all' partition\r\n    N'2018-01-01T00:00:00', -- This partition will contain all data from Jan 2018 onwards (until the next partition).\r\n    N'2019-01-01T00:00:00'  -- This partition will contain all data from Feb 2018 onwards (unless a subsequent partition is added in the future)\r\n);<\/pre>\n<h2>Partition Scheme<\/h2>\n<p>Next, we create the scheme to tell SQL Server how to organise the data on the disk(s):<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">--------------------------------------------------------------------------------\r\n-- Partition Scheme\r\n--------------------------------------------------------------------------------\r\nCREATE PARTITION SCHEME [FactTable_PS]\r\n    AS PARTITION [FactTable_PF]\r\nALL TO ([primary])\r\n;<\/pre>\n<h2>Partitioning by Applying a Function &amp; Schema<\/h2>\n<p>A table ban have a partition scheme applied to it, by applying a CLUSTERED index:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">--------------------------------------------------------------------------------\r\n-- Apply scheme using CLUSTERED INDEX\r\n--------------------------------------------------------------------------------\r\nCREATE CLUSTERED\r\n INDEX [CIDX_FactTable]\r\n    ON [dbo].[FactTable_2]\r\n      ([Date])\r\n    ON [FactTable_PS] ([Date])\r\n;<\/pre>\n<p>Note, in our example the above will fail. There is already a clustered index on the table (as there probably should be)! In this instance, that index has to be dropped and a new one created.<\/p>\n<p>If we are working with a very large table,this can take a lot of time. However, we can keep data available using: ONLINE = ON<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\"> DROP\r\nINDEX [PK_FactTable_unpartitioned]\r\n   ON [dbo].[FactTable_unpartitioned]\r\n;\r\n\r\nCREATE CLUSTERED\r\nINDEX DK_FactTable_unpartitioned\r\n    ON [dbo].[FactTable_unpartitioned]\r\n      ([Date])\r\nWITH (ONLINE = ON\r\n      )\r\n    ON [FactTable_PS] ([Date])\r\n;<\/pre>\n<h2>Partitioning by Copying to a New Table<\/h2>\n<p>This might be preferable for very large tables in busy environments&#8230; We will have two tables, one with the original data and one new partitioned table. The movement is best to be done in batches, this saves redo log and other overheads on the server during the migration. The migration can be done using a <a href=\"https:\/\/datablog.roman-halliday.com\/index.php\/2018\/06\/09\/dates-in-sql-server-iteration-of-date-ranges\/\">date loop<\/a> with a statement such as:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">-- In a loop\r\nINSERT\r\n  INTO [target_table]\r\nSELECT *\r\n  FROM [source_table]\r\n WHERE [partition_column] = @Date\r\n;<\/pre>\n<p>As this will take a long time (in some cases, many hours) and processes\/users will potentially still access the table. The point at which the tables are &#8220;switched over&#8221; is a key decision to make! There are benefits and dangers to switching (renaming) the tables before or after moving the data.<\/p>\n<ol>\n<li><strong>Before<\/strong>:\n<ol>\n<li>Advantages: Any process which adds data will automatically add it to the new table.<\/li>\n<li>Disadvantages: Specific update statements could be missed. Processes which use the table will not have access to the full dataset until it&#8217;s copied.<\/li>\n<\/ol>\n<\/li>\n<li><strong>After<\/strong>:\n<ol>\n<li>Advantages: All processes reading and writing data from the table will continue uninterrupted.<\/li>\n<li>Disadvantages: Processes will have to be managed so that all data changes made during the data copy process are also copied (even if an update is made to data for a date which has already been copied).<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>This is a good task for a weekend!<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Picking up on my series on partitioning, previously I looked at\u00a0Partitions in SQL Server: Creating a Partitioned Fact Table (by date) now I&#8217;m going to look into splitting an existing table into partitions. A key thing to remember is that the moving of data on disk can be time consuming and cause locks. The approaches&hellip;<\/p>\n<p class=\"read-more\"><a class=\"readmore-btn\" href=\"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/04\/14\/partitions-in-sql-server-partition-an-existing-fact-table-by-date\/\">Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4],"tags":[24],"class_list":["post-278","post","type-post","status-publish","format-standard","hentry","category-databases","category-sql-server","tag-partition"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Partitions in SQL Server: Partition an Existing Fact Table (by date) - Rows Across The Lake<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/04\/14\/partitions-in-sql-server-partition-an-existing-fact-table-by-date\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Partitions in SQL Server: Partition an Existing Fact Table (by date) - Rows Across The Lake\" \/>\n<meta property=\"og:description\" content=\"Picking up on my series on partitioning, previously I looked at\u00a0Partitions in SQL Server: Creating a Partitioned Fact Table (by date) now I&#8217;m going to look into splitting an existing table into partitions. A key thing to remember is that the moving of data on disk can be time consuming and cause locks. The approaches&hellip;Read More Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/04\/14\/partitions-in-sql-server-partition-an-existing-fact-table-by-date\/\" \/>\n<meta property=\"og:site_name\" content=\"Rows Across The Lake\" \/>\n<meta property=\"article:published_time\" content=\"2019-04-14T18:08:47+00:00\" \/>\n<meta name=\"author\" content=\"david\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@d_roman_h\" \/>\n<meta name=\"twitter:site\" content=\"@d_roman_h\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"david\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/index.php\\\/2019\\\/04\\\/14\\\/partitions-in-sql-server-partition-an-existing-fact-table-by-date\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/index.php\\\/2019\\\/04\\\/14\\\/partitions-in-sql-server-partition-an-existing-fact-table-by-date\\\/\"},\"author\":{\"name\":\"david\",\"@id\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/#\\\/schema\\\/person\\\/575f96d2590c3085923ff9e1b565748b\"},\"headline\":\"Partitions in SQL Server: Partition an Existing Fact Table (by date)\",\"datePublished\":\"2019-04-14T18:08:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/index.php\\\/2019\\\/04\\\/14\\\/partitions-in-sql-server-partition-an-existing-fact-table-by-date\\\/\"},\"wordCount\":622,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/#\\\/schema\\\/person\\\/575f96d2590c3085923ff9e1b565748b\"},\"keywords\":[\"partition\"],\"articleSection\":[\"Databases\",\"SQL Server\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/datablog.roman-halliday.com\\\/index.php\\\/2019\\\/04\\\/14\\\/partitions-in-sql-server-partition-an-existing-fact-table-by-date\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/index.php\\\/2019\\\/04\\\/14\\\/partitions-in-sql-server-partition-an-existing-fact-table-by-date\\\/\",\"url\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/index.php\\\/2019\\\/04\\\/14\\\/partitions-in-sql-server-partition-an-existing-fact-table-by-date\\\/\",\"name\":\"Partitions in SQL Server: Partition an Existing Fact Table (by date) - Rows Across The Lake\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/#website\"},\"datePublished\":\"2019-04-14T18:08:47+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/index.php\\\/2019\\\/04\\\/14\\\/partitions-in-sql-server-partition-an-existing-fact-table-by-date\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/datablog.roman-halliday.com\\\/index.php\\\/2019\\\/04\\\/14\\\/partitions-in-sql-server-partition-an-existing-fact-table-by-date\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/index.php\\\/2019\\\/04\\\/14\\\/partitions-in-sql-server-partition-an-existing-fact-table-by-date\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Partitions in SQL Server: Partition an Existing Fact Table (by date)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/#website\",\"url\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/\",\"name\":\"Rows Across The Lake\",\"description\":\"Data &amp; Databases\",\"publisher\":{\"@id\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/#\\\/schema\\\/person\\\/575f96d2590c3085923ff9e1b565748b\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/#\\\/schema\\\/person\\\/575f96d2590c3085923ff9e1b565748b\",\"name\":\"david\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/acddbc676a1d5c73795edcf0627ee39e5aa947da9033b58373e03d93122cb3b7?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/acddbc676a1d5c73795edcf0627ee39e5aa947da9033b58373e03d93122cb3b7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/acddbc676a1d5c73795edcf0627ee39e5aa947da9033b58373e03d93122cb3b7?s=96&d=mm&r=g\",\"caption\":\"david\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/acddbc676a1d5c73795edcf0627ee39e5aa947da9033b58373e03d93122cb3b7?s=96&d=mm&r=g\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Partitions in SQL Server: Partition an Existing Fact Table (by date) - Rows Across The Lake","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/04\/14\/partitions-in-sql-server-partition-an-existing-fact-table-by-date\/","og_locale":"en_GB","og_type":"article","og_title":"Partitions in SQL Server: Partition an Existing Fact Table (by date) - Rows Across The Lake","og_description":"Picking up on my series on partitioning, previously I looked at\u00a0Partitions in SQL Server: Creating a Partitioned Fact Table (by date) now I&#8217;m going to look into splitting an existing table into partitions. A key thing to remember is that the moving of data on disk can be time consuming and cause locks. The approaches&hellip;Read More Read More","og_url":"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/04\/14\/partitions-in-sql-server-partition-an-existing-fact-table-by-date\/","og_site_name":"Rows Across The Lake","article_published_time":"2019-04-14T18:08:47+00:00","author":"david","twitter_card":"summary_large_image","twitter_creator":"@d_roman_h","twitter_site":"@d_roman_h","twitter_misc":{"Written by":"david","Estimated reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/04\/14\/partitions-in-sql-server-partition-an-existing-fact-table-by-date\/#article","isPartOf":{"@id":"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/04\/14\/partitions-in-sql-server-partition-an-existing-fact-table-by-date\/"},"author":{"name":"david","@id":"https:\/\/datablog.roman-halliday.com\/#\/schema\/person\/575f96d2590c3085923ff9e1b565748b"},"headline":"Partitions in SQL Server: Partition an Existing Fact Table (by date)","datePublished":"2019-04-14T18:08:47+00:00","mainEntityOfPage":{"@id":"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/04\/14\/partitions-in-sql-server-partition-an-existing-fact-table-by-date\/"},"wordCount":622,"commentCount":0,"publisher":{"@id":"https:\/\/datablog.roman-halliday.com\/#\/schema\/person\/575f96d2590c3085923ff9e1b565748b"},"keywords":["partition"],"articleSection":["Databases","SQL Server"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/datablog.roman-halliday.com\/index.php\/2019\/04\/14\/partitions-in-sql-server-partition-an-existing-fact-table-by-date\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/04\/14\/partitions-in-sql-server-partition-an-existing-fact-table-by-date\/","url":"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/04\/14\/partitions-in-sql-server-partition-an-existing-fact-table-by-date\/","name":"Partitions in SQL Server: Partition an Existing Fact Table (by date) - Rows Across The Lake","isPartOf":{"@id":"https:\/\/datablog.roman-halliday.com\/#website"},"datePublished":"2019-04-14T18:08:47+00:00","breadcrumb":{"@id":"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/04\/14\/partitions-in-sql-server-partition-an-existing-fact-table-by-date\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/datablog.roman-halliday.com\/index.php\/2019\/04\/14\/partitions-in-sql-server-partition-an-existing-fact-table-by-date\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/04\/14\/partitions-in-sql-server-partition-an-existing-fact-table-by-date\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/datablog.roman-halliday.com\/"},{"@type":"ListItem","position":2,"name":"Partitions in SQL Server: Partition an Existing Fact Table (by date)"}]},{"@type":"WebSite","@id":"https:\/\/datablog.roman-halliday.com\/#website","url":"https:\/\/datablog.roman-halliday.com\/","name":"Rows Across The Lake","description":"Data &amp; Databases","publisher":{"@id":"https:\/\/datablog.roman-halliday.com\/#\/schema\/person\/575f96d2590c3085923ff9e1b565748b"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/datablog.roman-halliday.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/datablog.roman-halliday.com\/#\/schema\/person\/575f96d2590c3085923ff9e1b565748b","name":"david","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/acddbc676a1d5c73795edcf0627ee39e5aa947da9033b58373e03d93122cb3b7?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/acddbc676a1d5c73795edcf0627ee39e5aa947da9033b58373e03d93122cb3b7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/acddbc676a1d5c73795edcf0627ee39e5aa947da9033b58373e03d93122cb3b7?s=96&d=mm&r=g","caption":"david"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/acddbc676a1d5c73795edcf0627ee39e5aa947da9033b58373e03d93122cb3b7?s=96&d=mm&r=g"}}]}},"_links":{"self":[{"href":"https:\/\/datablog.roman-halliday.com\/index.php\/wp-json\/wp\/v2\/posts\/278","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/datablog.roman-halliday.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/datablog.roman-halliday.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/datablog.roman-halliday.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/datablog.roman-halliday.com\/index.php\/wp-json\/wp\/v2\/comments?post=278"}],"version-history":[{"count":2,"href":"https:\/\/datablog.roman-halliday.com\/index.php\/wp-json\/wp\/v2\/posts\/278\/revisions"}],"predecessor-version":[{"id":297,"href":"https:\/\/datablog.roman-halliday.com\/index.php\/wp-json\/wp\/v2\/posts\/278\/revisions\/297"}],"wp:attachment":[{"href":"https:\/\/datablog.roman-halliday.com\/index.php\/wp-json\/wp\/v2\/media?parent=278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/datablog.roman-halliday.com\/index.php\/wp-json\/wp\/v2\/categories?post=278"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/datablog.roman-halliday.com\/index.php\/wp-json\/wp\/v2\/tags?post=278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}