Change Data Capture - for Incremental load - Pls help
Hi, I tried CDC for incremental load.but facing a issue. 1. DFT1 , I loaded ALL the records from _CT table to intermediate 'Staging_product' table. 2. Execute SQL task with the command 'select max (__$start_lsn) as max from staging_product' and get the value of max (__$start_lsn) into a variable called "Var:Max" - datatype:Object. 3. DFT2 3a)Source > OLEDB Source > Query: select * from staging_product where __$start_lsn> ?' and mapped the parameter to the variable "Max" 3b)Conditional Split > Conditions > insert --__$operation == 2, update=__$operation == 4, delete=__$operation == 1 3c) Insert output > Lookup with Target table > Select productid from productfinal > Then, OLEDB desn > Insert 3d) Update output > OLEDB Command > update productfinal set productname=? where productid=? 3e) Delete output > OLEDB Command > delete from productfinal where productid=? The issue is, from source it is getting ALL the records from staging table and then splits using Conditional transformation. What i require is, it should fetch the records only from the Max __$start_lsn,rite? I really appreciate your help!!
July 26th, 2012 1:45am

Hi Revathy, Could you please try to execute the below query and see the result . 'select max (__$start_lsn) as max from staging_product' .
Free Windows Admin Tool Kit Click here and download it now
July 26th, 2012 6:59am

Hi Revathy Menon, Besides Ashwin's suggestion, please check the Result Set page of the Execute SQL Task Editor dialog, and see if the result of the SQL statement maps to the variable. You can refer to the detail steps about mapping Result Sets to Variables in an Execute SQL Task: http://technet.microsoft.com/en-us/library/cc280492.aspx Thanks, Eileen TechNet Subscriber Support If you are TechNet Subscription user and have any feedback on our support quality, please send your feedback here.
August 2nd, 2012 6:19am

Check for the implimentation and sample packages here http://msftisprodsamples.codeplex.com/wikipage?title=SS2008!Change%20Data%20Capture%20for%20Specified%20Interval%20Package%20Sample&ProjectName=msftisprodsamples http://msftisprodsamples.codeplex.com/wikipage?title=SS2008!Change%20Data%20Capture%20since%20Last%20Request%20Package%20Sample&ProjectName=msftisprodsamples I have implimneted a sample here http://bishtabhinav.wordpress.com/2012/06/01/cdc-feature-in-sql-server-2008-r2/ Abhinav http://bishtabhinav.wordpress.com/
Free Windows Admin Tool Kit Click here and download it now
August 2nd, 2012 7:00am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics