
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_SIGNCOMPANY' AND KSQL_COL_NAME IN ('FREORGID'))
 ALTER TABLE T_HBSS_SIGNCOMPANY ADD (FREORGID BIGINT DEFAULT 0 NOT NULL );
 --- drop column --------- 请认真检查该脚本 -------------------
 EXEC p_AlterColumn 'T_HBSS_SIGNCOMPANY', 'FRELATIONTYPEID', 'NULL', 'NULL', '1001', 'NULL';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_SIGNCOMPANYHIS' AND KSQL_COL_NAME IN ('FREORGID'))
 ALTER TABLE T_HBSS_SIGNCOMPANYHIS ADD (FREORGID BIGINT DEFAULT 0 NOT NULL );
 --- drop column --------- 请认真检查该脚本 -------------------
 EXEC p_AlterColumn 'T_HBSS_SIGNCOMPANYHIS', 'FRELATIONTYPEID', 'NULL', 'NULL', '1001', 'NULL';