<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Using Incremental load logic with SQL 08 Change Data Capture (CDC) Feature in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-Incremental-load-logic-with-SQL-08-Change-Data-Capture-CDC/m-p/373470#M703136</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;QV Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are upgrading our SQL server soon to the 08 edition. One of the databases I pull info from is on this server and its an operational DB. I've been told that read access will be cut off after the upgrade and that I must incorporate Change Data Capture (CDC) into my logic. Problem is that I know little about it. I have a QVW that is solely used to create my QVDs and I am using some incremental load logic. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am hoping that someone could offer their expertise on SQL functionality so that I may be able to incorperate it into my existing logic. Below are some specifics:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;On my initial load I direct QV to a back up of the operational DB which will serve as my base QVD data and on every subsequent load new data will be available only through the CDC tables.&lt;/LI&gt;&lt;LI&gt;Due to security issues I will have to have QV execute a stored procedure which will load the CDC data in staging tables. (all fields are a mirror image of the original tables except for fields generated by the CDC)&lt;/LI&gt;&lt;LI&gt;I have to incorporate the LSN (Logical Sequence Number) into my logic&lt;/LI&gt;&lt;LI&gt;I have to use the values in the __$operation field to deal with inserts, updates and deletes (All of my tables are updates and inserts only)﻿. _$operationcolumn values are:&amp;nbsp; 1 = delete, 2 = insert, 3 = update (values before update) which I am&amp;nbsp; ignore and 4=update (values after update).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From what I have read the LSN is a binary number but I am not sure how to get the MAX to use in logic. SQL has a function for it but dont know how to use it in QV. I've attached example of how I am dealing inserts and updatable tables currently. The stored procedure I was given and need to be executing is:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;SQL execute&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt; [DBA]&lt;SPAN style="color: gray;"&gt;.&lt;/SPAN&gt;[CDC_Read] &lt;SPAN style="color: red;"&gt;'2012-06-12'&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: red;"&gt;'2012-06-13'&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;,&lt;/SPAN&gt; 'ActivityLog'&lt;SPAN style="color: red;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;But I think I should replace the dates with QV variables but not sure how to do this yet.&lt;/P&gt;&lt;P&gt;Maybe something like:&amp;nbsp; SQL EXECUTE [DBA].[CDC_Read] '$(vCDCStart)', '$(vCDCEnd)', 'ActivityLog';&lt;/P&gt;&lt;P&gt;I was given this link to see example of the SQL execution script to get ideas: &lt;A href="http://www.codeproject.com/Articles/166250/Microsoft-SQL-Server-2008-Change-Data-Capture-CDC"&gt;http://www.codeproject.com/Articles/166250/Microsoft-SQL-Server-2008-Change-Data-Capture-CDC&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Jun 2012 01:13:14 GMT</pubDate>
    <dc:creator>villegasi03</dc:creator>
    <dc:date>2012-06-29T01:13:14Z</dc:date>
    <item>
      <title>Using Incremental load logic with SQL 08 Change Data Capture (CDC) Feature</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Incremental-load-logic-with-SQL-08-Change-Data-Capture-CDC/m-p/373470#M703136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;QV Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are upgrading our SQL server soon to the 08 edition. One of the databases I pull info from is on this server and its an operational DB. I've been told that read access will be cut off after the upgrade and that I must incorporate Change Data Capture (CDC) into my logic. Problem is that I know little about it. I have a QVW that is solely used to create my QVDs and I am using some incremental load logic. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am hoping that someone could offer their expertise on SQL functionality so that I may be able to incorperate it into my existing logic. Below are some specifics:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;On my initial load I direct QV to a back up of the operational DB which will serve as my base QVD data and on every subsequent load new data will be available only through the CDC tables.&lt;/LI&gt;&lt;LI&gt;Due to security issues I will have to have QV execute a stored procedure which will load the CDC data in staging tables. (all fields are a mirror image of the original tables except for fields generated by the CDC)&lt;/LI&gt;&lt;LI&gt;I have to incorporate the LSN (Logical Sequence Number) into my logic&lt;/LI&gt;&lt;LI&gt;I have to use the values in the __$operation field to deal with inserts, updates and deletes (All of my tables are updates and inserts only)﻿. _$operationcolumn values are:&amp;nbsp; 1 = delete, 2 = insert, 3 = update (values before update) which I am&amp;nbsp; ignore and 4=update (values after update).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From what I have read the LSN is a binary number but I am not sure how to get the MAX to use in logic. SQL has a function for it but dont know how to use it in QV. I've attached example of how I am dealing inserts and updatable tables currently. The stored procedure I was given and need to be executing is:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;SQL execute&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt; [DBA]&lt;SPAN style="color: gray;"&gt;.&lt;/SPAN&gt;[CDC_Read] &lt;SPAN style="color: red;"&gt;'2012-06-12'&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: red;"&gt;'2012-06-13'&lt;/SPAN&gt;&lt;SPAN style="color: gray;"&gt;,&lt;/SPAN&gt; 'ActivityLog'&lt;SPAN style="color: red;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;But I think I should replace the dates with QV variables but not sure how to do this yet.&lt;/P&gt;&lt;P&gt;Maybe something like:&amp;nbsp; SQL EXECUTE [DBA].[CDC_Read] '$(vCDCStart)', '$(vCDCEnd)', 'ActivityLog';&lt;/P&gt;&lt;P&gt;I was given this link to see example of the SQL execution script to get ideas: &lt;A href="http://www.codeproject.com/Articles/166250/Microsoft-SQL-Server-2008-Change-Data-Capture-CDC"&gt;http://www.codeproject.com/Articles/166250/Microsoft-SQL-Server-2008-Change-Data-Capture-CDC&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2012 01:13:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Incremental-load-logic-with-SQL-08-Change-Data-Capture-CDC/m-p/373470#M703136</guid>
      <dc:creator>villegasi03</dc:creator>
      <dc:date>2012-06-29T01:13:14Z</dc:date>
    </item>
  </channel>
</rss>

