# `Sp_Del_BusinessTable_Data` (procedure)

> 根据模块sId删除模块（包含子模块）


- **Type:** PROCEDURE
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | OUT | `sReturn` | `varchar(4000)` |
| 2 | OUT | `sCode` | `int` |

## Body

_Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `Sp_Del_BusinessTable_Data`'`._

## Narrative

**Business context:** Installation / data-purge tool — wipes only the transactional (单据) tables. Used when an environment needs its cashier, manufacturing, inventory, sales, purchasing and outsourcing history reset while keeping basic data (customers, products, materials, employees) intact. Sibling of `Sp_Del_BasicsTable_Data`.

**What it does:** Sets `sCode=1`/`sReturn=''`, then `TRUNCATE`s the transactional set: cashier (`cah*`), account opening (`accmaterialsinit*`), production-apply (`mitproductionapply*`), manufacturing (`mftqualityaccident*`, `mftworkorder*` master/slave + materials + process + control + param + combine + their `_tmp` shadows, `mftproductionplan*`, `mftproductionreport*`), materials inventory (`mitcheckprofitloss`, `mitmaterialsadjust*`, `mitmaterialscheck*`, `mitmaterialscut*`, `mitmaterialsstore`, `mitmaterialsstorevirtual`, `elematerialsstock` and its month/cost shadows, `mitmaterialsstoreadjustment*`, `mitproductionmaterials*`), outsourcing (`opsoutside*`, `opsqualityabnormal*`), and product-in-store (`pit*` family). Resets `erpmerge*` queues.

**Invocation:** Status: appears orphaned. No `gdsmodule` hook, no `gdsconfigformmaster` data-source, no other routine references it. xly-src ships both `script/标版/30100101/Sp_Del_BusinessTable_Data.sql` and `script/del/Sp_Del_BusinessTable_Data.sql` — the former is the standard 30100101-version installer, the latter is the maintenance variant. Verify which is currently deployed.
