# `sp_alert_bit` (procedure) > 设置bit为必填,默认值为0 - **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_alert_bit`'`._ ## Narrative **Business context:** DBA schema-migration helper. Header says 设置bit为必填,默认值为0 — one-shot installer that hardens every nullable `bit` column in the `xlyweberp` database to `NOT NULL DEFAULT 0`. **What it does:** Counts the columns in `information_schema.COLUMNS` where `IS_NULLABLE='YES'`, `DATA_TYPE='bit'`, and the table is not a `viw_*` view nor the two `gdsconfigform*masterview` views. For each match, cursors through, runs `UPDATE SET =0 WHERE IS NULL`, then `ALTER TABLE CHANGE bit NOT NULL default 0` via dynamic SQL. **Invocation:** Status: appears orphaned. Lives in `xly-src/script/标版/30100101/sp_alert_bit.sql` (the install-time DDL bundle), not bound to any `gdsmodule` hook, form, or other routine. Run manually by a DBA during initial deployment or schema-hardening sweeps. Candidate for maintainer audit if found in a runtime call path.