Avoid multiple start date for given product RRS feed

  • Question

  • Hi All,

    I have a requirement to load data into target table, before load data to target table for any product giving new startdate with out expiring old one, those records we need to identify by comparing stage and target table.

    Stage table:

    Product Startdate Enddate
    P1 03-01-2020 03-10-2020
    P1 03-11-2020 12/31/2020

    P3 07-30-2020 12/31/9999
    P4 08-15-2020 12/31/9999

    Target table(Initial load):

    Product Startdate Enddate
    P1 03-01-2020 12/31/9999
    P2 01-01-2010 12/31/9999
    P3 02-02-2020 12/31/9999
    P4 04-01-2020 12/31/9999

    In target table product P3 and P4 are active records, from stage table again we are getting active records for same product. this is not expected one, we need to return status value as 1 if everything good returns value as 0. 

    Wednesday, November 11, 2020 1:42 PM

All replies

  • Hi Praveenci

    This forum is dedicated to supporting issues related to open specification. You can access open specifications at https://docs.microsoft.com/en-us/openspecs/. Your inquiry does not seem to be related to open specifications.

    For a better chance of getting an answer to your question, you may want to post your question to the following forum: https://docs.microsoft.com/en-us/answers/products/sql-server

    HungChun Yu (MSFT)

    Wednesday, November 11, 2020 3:43 PM