# `Sp_format_column` (procedure)

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


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

## Parameters

_No parameters._

## Body

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

## Narrative

**Business context:** Form-metadata grooming helper. The auto-catalog inherits a misleading `COMMENT '根据模块sId删除模块（包含子模块）'` — the actual body normalises grid-column widths and visibility flags across every form, sweeping `gdsconfigformslave` and `gdsconfigformuserslave` (per-user override table). Not a user-facing routine; a one-shot DBA tidy.

**What it does:** Hides any column whose `sName` ends in `Id` (except `bInvalid` and `sPeriodId`). Sets uniform `iFitWidth` per column prefix/suffix convention — `b*` → 35, `i*` → 40, `d*` → 70, `t*` → 85, `*Money/*Price` → 70, `*Style` → 85, `sBillNo/sWorkOrderNo/sOrderNo` → 110 (and forces `bVisible=1, sChinese='单据号'` for `sBillNo`), `sCustomerName/sSupplyName/sProductName` → 150, `sMaterialsName` → 200, `*ManName/*person` → 56, `*Unit` → 40 (with `sMaterialsUnit` → 55 / "换算单位"), `sStoreShelveName` → 60 / "存放位置", `sPartsName` → 80 / "部件名称", `iOrder` → 60.

**Invocation:** Status: appears orphaned. No caller found in any channel — no `gdsmodule` hook, no `gdsconfigformmaster` reference, no other proc CALLs it, no xly-src grep hit. Intended as a manual DBA tool run via `CALL Sp_format_column()` after large metadata imports; the misleading `COMMENT` is a copy-paste bug and should not be trusted.
