Merge Customization - Addresses

Has anyone customized the merge procedure so that it does not inactivate addresses from the deleted record? Can you please share? We are merging consortium records, but each organization has its own control-group address types that we need to keep active and it is time consuming to manually update each record after the scheduled merge runs. Thanks!!

Parents
  • Hi Stephanie,

    We've got the following code in our LP_CONST_MERGE procedure in order to retain addresses (similar code also exists for email addresses) :

    UPDATE a

    Set Inactive = 'N'

    from T_Address a

    where a.customer_no = @kept_id

    and a.last_update_dt > dateadd(Hour,-1,getdate())

    --and last_updated_by = 'dbo'  -- not sure if dbo would be used by the merge proc for this field.

    and a.inactive = 'Y'

    and not exists (select 1 from t_address b 

    where b.customer_no = a.customer_no

    and b.inactive = 'N'

    and b.address_type = a.address_type

    and b.street1 = a.street1

    and b.city = a.city

    and ISNULL(b.state, '') = ISNULL(a.state, '')

    )

     

    Stacey Voigt
    Consortium Services Manager
    Santa Barbara Center for the Performing Arts
    svoigt@granadasb.org

Reply
  • Hi Stephanie,

    We've got the following code in our LP_CONST_MERGE procedure in order to retain addresses (similar code also exists for email addresses) :

    UPDATE a

    Set Inactive = 'N'

    from T_Address a

    where a.customer_no = @kept_id

    and a.last_update_dt > dateadd(Hour,-1,getdate())

    --and last_updated_by = 'dbo'  -- not sure if dbo would be used by the merge proc for this field.

    and a.inactive = 'Y'

    and not exists (select 1 from t_address b 

    where b.customer_no = a.customer_no

    and b.inactive = 'N'

    and b.address_type = a.address_type

    and b.street1 = a.street1

    and b.city = a.city

    and ISNULL(b.state, '') = ISNULL(a.state, '')

    )

     

    Stacey Voigt
    Consortium Services Manager
    Santa Barbara Center for the Performing Arts
    svoigt@granadasb.org

Children
No Data