{"id":1019,"date":"2021-01-25T02:16:18","date_gmt":"2021-01-25T02:16:18","guid":{"rendered":"http:\/\/jackofalltradesmasterofsome.com\/blog\/?p=1019"},"modified":"2021-02-05T14:35:32","modified_gmt":"2021-02-05T14:35:32","slug":"streaming-etl-with-azure-data-factory-and-cdc-setting-up-audit-tables","status":"publish","type":"post","link":"https:\/\/jackofalltradesmasterofsome.com\/blog\/2021\/01\/25\/streaming-etl-with-azure-data-factory-and-cdc-setting-up-audit-tables\/","title":{"rendered":"Streaming ETL with Azure Data Factory and CDC &#8211; Setting up Audit Tables"},"content":{"rendered":"\n<p>In this series we look at building a Streaming ETL with Azure Data Factory and CDC &#8211; Setting up Audit Tables. This is Part 1, The rest of the series is below.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><a href=\"http:\/\/jackofalltradesmasterofsome.com\/blog\/2021\/01\/25\/streaming-etl-with-azure-data-factory-and-cdc-enabling-cdc\/\">Enabling CDC<\/a><\/li><li><a href=\"http:\/\/jackofalltradesmasterofsome.com\/blog\/2021\/01\/25\/streaming-etl-with-azure-data-factory-and-cdc-setting-up-audit-tables\/\">Setting up Audit Tables<\/a><\/li><li><a href=\"http:\/\/jackofalltradesmasterofsome.com\/blog\/2021\/01\/25\/streaming-etl-with-azure-data-factory-and-cdc-provisioning-azure-data-factory\/\">Provisioning Azure Data Factory<\/a><\/li><li><a href=\"http:\/\/jackofalltradesmasterofsome.com\/blog\/2021\/01\/25\/streaming-etl-with-azure-data-factory-and-cdc-provisioning-provisioning-azure-blob-storage\/\">Provisioning Azure Blog Storage<\/a><\/li><li><a href=\"http:\/\/jackofalltradesmasterofsome.com\/blog\/2021\/01\/27\/streaming-etl-with-azure-data-factory-and-cdc-creating-a-data-source-connection-in-azure-data-factory\/\">Create Data Source Connection in ADF<\/a><\/li><li><a href=\"http:\/\/jackofalltradesmasterofsome.com\/blog\/2021\/01\/27\/streaming-etl-with-azure-data-factory-and-incremental-pipeline-azure-data-factory\/\">Create Incremental Pipeline in ADF<\/a><\/li><li><a href=\"http:\/\/jackofalltradesmasterofsome.com\/blog\/2021\/01\/27\/streaming-etl-with-azure-data-factory-and-create-a-parameter-driver-pipeline\/\">Create a Parameter Driven Pipeline<\/a><\/li><li><a href=\"http:\/\/jackofalltradesmasterofsome.com\/blog\/2021\/01\/27\/streaming-etl-with-azure-data-factory-and-cdc-creating-the-rolling-etl-window\/\">Create a Rolling Trigger<\/a><\/li><\/ol>\n\n\n\n<p>This series uses the Adventureworks database. For more information on how to get that set up see my Youtube video for <a href=\"https:\/\/www.youtube.com\/watch?v=JsrQGU7rhYA\">Downloading <\/a>and <a href=\"https:\/\/www.youtube.com\/watch?v=YL4-wMriI8s\">Restoring<\/a> the database.  <\/p>\n\n\n\n<p>Setting up Audit Tables<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Audit tables will be required to track what has\nbeen loaded and sent to the streaming process of the ETL. The second step will\nseed this table with the first row of data.<\/li><\/ol>\n\n\n\n<p>\/********Code************\/<\/p>\n\n\n\n<p>&#8212; Create Separate Offset Table to Manage\nLast Position\/Row Sent to Azure<\/p>\n\n\n\n<p>CREATE TABLE [dbo].[Audit_Streaming_ETL]<\/p>\n\n\n\n<p>(<\/p>\n\n\n\n<p>&nbsp;[TableName] [varchar](50) NOT NULL,<\/p>\n\n\n\n<p>&nbsp;[MaxVal] [binary](10) NOT NULL,<\/p>\n\n\n\n<p>&nbsp;[LastUpdateDateTime] [datetime] NOT NULL\nDEFAULT getdate(),<\/p>\n\n\n\n<p>&nbsp;[LastCheckedDateTime] [datetime] NOT NULL\nDEFAULT getdate(),<\/p>\n\n\n\n<p>&nbsp;CONSTRAINT [PK_Audit_Streaming_ETL] PRIMARY\nKEY NONCLUSTERED <\/p>\n\n\n\n<p>&nbsp;(<\/p>\n\n\n\n<p>&nbsp;[TableName] ASC<\/p>\n\n\n\n<p>&nbsp;) <\/p>\n\n\n\n<p>) <\/p>\n\n\n\n<p>GO<\/p>\n\n\n\n<p>INSERT INTO [dbo].[Audit_Streaming_ETL] <\/p>\n\n\n\n<p>SELECT &#8221;, 0x0000000000000000000, &#8216;1900-01-01 00:00:00&#8217;, &#8216;1900-01-01 00:00:00&#8217;<\/p>\n\n\n\n<p>Streaming ETL with Azure Data Factory and CDC &#8211; Setting up Audit Tables<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this series we look at building a Streaming ETL with Azure Data Factory and CDC &#8211; Setting up Audit Tables. This is Part 1, The rest of the series is below. Enabling CDC Setting up Audit Tables Provisioning Azure Data Factory Provisioning Azure Blog Storage Create Data Source Connection in ADF Create Incremental Pipeline [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":822,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,28,27,11,1],"tags":[104],"class_list":["post-1019","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","category-azure","category-big-data","category-data-warehouse","category-uncategorized","tag-azure-data-factory"],"_links":{"self":[{"href":"https:\/\/jackofalltradesmasterofsome.com\/blog\/wp-json\/wp\/v2\/posts\/1019","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jackofalltradesmasterofsome.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jackofalltradesmasterofsome.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jackofalltradesmasterofsome.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jackofalltradesmasterofsome.com\/blog\/wp-json\/wp\/v2\/comments?post=1019"}],"version-history":[{"count":2,"href":"https:\/\/jackofalltradesmasterofsome.com\/blog\/wp-json\/wp\/v2\/posts\/1019\/revisions"}],"predecessor-version":[{"id":1084,"href":"https:\/\/jackofalltradesmasterofsome.com\/blog\/wp-json\/wp\/v2\/posts\/1019\/revisions\/1084"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jackofalltradesmasterofsome.com\/blog\/wp-json\/wp\/v2\/media\/822"}],"wp:attachment":[{"href":"https:\/\/jackofalltradesmasterofsome.com\/blog\/wp-json\/wp\/v2\/media?parent=1019"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jackofalltradesmasterofsome.com\/blog\/wp-json\/wp\/v2\/categories?post=1019"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jackofalltradesmasterofsome.com\/blog\/wp-json\/wp\/v2\/tags?post=1019"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}