Removing sales tax overrides from customer records

Overview

This article outlines how to remove sales tax overrides from multiple customer records through a bulk operation in the database.

 

Solution

Execute the following queries on the database:

  1. Backup the records to be updated by executing the following SQL query:
    select c.cust_code, c.name, x.name list_name, c.billcode, a.addr_code, a.custchar8, a.custchar9
    into zd2266225_addr
    from cust c inner join address a on c.BILLCODE = a.addr_code and c.cust_code = a.CUST_CODE
    inner join zd2266225_list x on c.cust_code = x.cust_code
  2. Execute the following update statement to remove the sales tax overrides and commit the changes:
    begin transaction
    update address set custchar8 = null, custchar9 = null from zd2266225_addr x
    where address.addr_code = x.ADDR_CODE
    and address.CUST_CODE= x.CUST_CODE and x.custchar8 = ADDRESS.custchar8 and x.custchar9 = address.custchar9
    commit transaction

Testing

The updated customer records should have the sales tax overrides removed.

Back to top

Comments

0 comments

Please sign in to leave a comment.