Which table stores all the customer data?
The two tables
ASC_CUS_TBL is the historic Access Supply Chain customer master file. Its structure mirrors the COBOL CUS-RECORD layout keyed on CUS-CODE, holding invoice/delivery names, addresses, VAT number, terms, analysis codes, etc. It originally existed as a physical base table.
SL_ACCOUNTS is the Sales Ledger customer accounts table, keyed on CUCODE, holding CUNAME, CUADDRESS, contact, phone, email, currency, VAT registration, country, etc. It is the core of the customer record and is joined with SL_ACCOUNTS2, SL_ACCOUNTS3, SL_TERMS and SL_ADDRESSES to make up the full account.
Why SL_ACCOUNTS is the master
In the v45/v48 upgrade scripts, the physical ASC_CUS_TBL table is dropped and its rows are migrated into the sales-ledger structures. The comment states: "Copy ASC_CUS_TBL rows to ASC_SL_ACCOUNTS rows before dropping table ASC_CUS_TBL".
After that migration, ASC_CUS_TBL is recreated as a view whose source is SL_ACCOUNTS, joined to SL_TERMS, ASC_SL_ACCOUNTS, SL_ACCOUNTS2 and SL_ADDRESSES. So the fields the COBOL programs read as CUS_* are actually derived from SL_ACCOUNTS columns at query time.
The core name/address/contact columns in that view come straight from SL_ACCOUNTS (e.g. CUCODE, CUNAME, CUPHONE, CUCONTACT, CUCURRENCYCODE, CU_VAT_REG_NO, CUFAX), while only order-processing-specific extras come from the companion ASC_SL_ACCOUNTS table.
Summary
SL_ACCOUNTS(together withSL_ACCOUNTS2,SL_ACCOUNTS3,SL_TERMS,SL_ADDRESSES) is the master data store for customer details.ASC_CUS_TBLis a backward-compatibility layer for the legacy COBOL programs; in current versions it is a view overSL_ACCOUNTSrather than an independent store of customer data.
If you want the single authoritative "main customer details," query SL_ACCOUNTS (by CUCODE). Note that different customer address rows are distinguished by CU_ACCOUNT_TYPE = 0 for the main account in some reporting views.
