/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\IM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_IM_SETTLEPLAN') 
 CREATE TABLE T_IM_SETTLEPLAN (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(120) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT 'A' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FSETTLEPRICINGTIMEPOINT NVARCHAR(20) DEFAULT 'billauditdate' NOT NULL,
FBILLGENERATE CHAR(1) DEFAULT '0' NOT NULL,
FISDEFAULT CHAR(1) DEFAULT '0' NOT NULL
);


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

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_SALOUTBILL_C', 'FRECCUSTOMERID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_SALOUTBILL_C', 'FSETTLECUSTOMERID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_SALOUTBILL_C', 'FPAYINGCUSTOMERID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_SALOUTBILL_C', 'FLOCATION', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_SALOUTBILL_C', 'FRECEIVECONTACTID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_SALOUTBILL_C', 'FRECEIVEADDRESS', 'NULL', 'NULL', '1001', 'NULL';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY_F' AND KSQL_COL_NAME IN ('FACTUALPRICE')) 
 ALTER TABLE T_IM_SALOUTBILLENTRY_F ADD (FACTUALPRICE DECIMAL(23,10) );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY_F' AND KSQL_COL_NAME IN ('FACTUALTAXPRICE')) 
 ALTER TABLE T_IM_SALOUTBILLENTRY_F ADD (FACTUALTAXPRICE DECIMAL(23,10) );
 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_SALOUTBILL_F', 'FEXRATETABLEID', 'NULL', 'NULL', '1001', 'NULL';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME IN ('FOUTOWNERTYPE')) 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FOUTOWNERTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME IN ('FOUTOWNERID')) 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FOUTOWNERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME IN ('FOUTKEEPERTYPE')) 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FOUTKEEPERTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME IN ('FOUTKEEPERID')) 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FOUTKEEPERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME IN ('FDELIVERYWAYID')) 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FDELIVERYWAYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME IN ('FRECCUSTOMERID')) 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FRECCUSTOMERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME IN ('FSETTLECUSTOMERID')) 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FSETTLECUSTOMERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME IN ('FPAYINGCUSTOMERID')) 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FPAYINGCUSTOMERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME IN ('FLOCATION')) 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FLOCATION NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME IN ('FRECEIVEADDRESS')) 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FRECEIVEADDRESS NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME IN ('FRECEIVECONTACTID')) 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FRECEIVECONTACTID BIGINT DEFAULT 0 NOT NULL );
 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_SALOUTBILLENTRY', 'FENTRYDC', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_SALOUTBILLENTRY', 'FINVUNITID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_SALOUTBILLENTRY', 'FQTYINVUNIT', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_SALOUTBILLENTRY', 'FINVUNITRATE', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_SALOUTBILLENTRY', 'FENTRYINVSCHEMEID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_SALOUTBILLENTRY', 'FPRICEUNITID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_SALOUTBILLENTRY', 'FPRICEUNITRATE', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_SALOUTBILLENTRY', 'FPRICEQTY', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_SALOUTBILLENTRY', 'FSERIALQTY', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_SALOUTBILLENTRY', 'FSERIALUNITID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_SALOUTBILLENTRY', 'FSERIALUNITRATE', 'NULL', 'NULL', '1001', 'NULL';

 EXEC p_AlterColumn 'T_IM_INVENTORY', 'FDISABLEDATE', 'DATETIME', 'NULL', '0011', 'NULL';

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

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_PURINBILL_S', 'FPROVIDERADDRESS', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_PURINBILL_S', 'FPROVIDERLINKMANID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_PURINBILL_S', 'FRECEIVESUPPLIERID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_PURINBILL_S', 'FINVOICESUPPLIERID', 'NULL', 'NULL', '1001', 'NULL';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY_F' AND KSQL_COL_NAME IN ('FACTUALPRICE')) 
 ALTER TABLE T_IM_PURINBILLENTRY_F ADD (FACTUALPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY_F' AND KSQL_COL_NAME IN ('FACTUALTAXPRICE')) 
 ALTER TABLE T_IM_PURINBILLENTRY_F ADD (FACTUALTAXPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME IN ('FPROVIDERSUPPLIERID')) 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FPROVIDERSUPPLIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME IN ('FPROVIDERADDRESS')) 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FPROVIDERADDRESS NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME IN ('FPROVIDERLINKMANID')) 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FPROVIDERLINKMANID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME IN ('FINVOICESUPPLIERID')) 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FINVOICESUPPLIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME IN ('FRECEIVESUPPLIERID')) 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FRECEIVESUPPLIERID BIGINT DEFAULT 0 NOT NULL );
 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_PURINBILLENTRY', 'FINVUNITID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_PURINBILLENTRY', 'FQTYINVUNIT', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_PURINBILLENTRY', 'FINVUNITRATE', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_PURINBILLENTRY', 'FSERIALQTY', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_PURINBILLENTRY', 'FSERIALUNITID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_PURINBILLENTRY', 'FSERIALUNITRATE', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_PURINBILLENTRY', 'FPRICEUNITID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_PURINBILLENTRY', 'FPRICEUNITRATE', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_PURINBILLENTRY', 'FPRICEQTY', 'NULL', 'NULL', '1001', 'NULL';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSAPPLYENTRY' AND KSQL_COL_NAME IN ('FAUDITQTY')) 
 ALTER TABLE T_IM_TRANSAPPLYENTRY ADD (FAUDITQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSAPPLYENTRY' AND KSQL_COL_NAME IN ('FUNIT3RDID')) 
 ALTER TABLE T_IM_TRANSAPPLYENTRY ADD (FUNIT3RDID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSAPPLYENTRY' AND KSQL_COL_NAME IN ('FQTYUNIT3RD')) 
 ALTER TABLE T_IM_TRANSAPPLYENTRY ADD (FQTYUNIT3RD DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSAPPLYENTRY' AND KSQL_COL_NAME IN ('FUNIT3RDRATE')) 
 ALTER TABLE T_IM_TRANSAPPLYENTRY ADD (FUNIT3RDRATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_TRANSAPPLYENTRY', 'FINVUNITID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_TRANSAPPLYENTRY', 'FQTYINVUNIT', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_TRANSAPPLYENTRY', 'FINVUNITRATE', 'NULL', 'NULL', '1001', 'NULL';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHEROUTBILLENTRY' AND KSQL_COL_NAME IN ('FOUTOWNERTYPE')) 
 ALTER TABLE T_IM_OTHEROUTBILLENTRY ADD (FOUTOWNERTYPE NVARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHEROUTBILLENTRY' AND KSQL_COL_NAME IN ('FOUTOWNERID')) 
 ALTER TABLE T_IM_OTHEROUTBILLENTRY ADD (FOUTOWNERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHEROUTBILLENTRY' AND KSQL_COL_NAME IN ('FOUTKEEPERTYPE')) 
 ALTER TABLE T_IM_OTHEROUTBILLENTRY ADD (FOUTKEEPERTYPE NVARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHEROUTBILLENTRY' AND KSQL_COL_NAME IN ('FOUTKEEPERID')) 
 ALTER TABLE T_IM_OTHEROUTBILLENTRY ADD (FOUTKEEPERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHERINBILL' AND KSQL_COL_NAME IN ('FSETTLECURRENCYID')) 
 ALTER TABLE T_IM_OTHERINBILL ADD (FSETTLECURRENCYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHERINBILLENTRY' AND KSQL_COL_NAME IN ('FOUTOWNERTYPE')) 
 ALTER TABLE T_IM_OTHERINBILLENTRY ADD (FOUTOWNERTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHERINBILLENTRY' AND KSQL_COL_NAME IN ('FOUTOWNERID')) 
 ALTER TABLE T_IM_OTHERINBILLENTRY ADD (FOUTOWNERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHERINBILLENTRY' AND KSQL_COL_NAME IN ('FOUTKEEPERTYPE')) 
 ALTER TABLE T_IM_OTHERINBILLENTRY ADD (FOUTKEEPERTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHERINBILLENTRY' AND KSQL_COL_NAME IN ('FOUTKEEPERID')) 
 ALTER TABLE T_IM_OTHERINBILLENTRY ADD (FOUTKEEPERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHERINBILLENTRY' AND KSQL_COL_NAME IN ('FPRICE')) 
 ALTER TABLE T_IM_OTHERINBILLENTRY ADD (FPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHERINBILLENTRY' AND KSQL_COL_NAME IN ('FAMOUNT')) 
 ALTER TABLE T_IM_OTHERINBILLENTRY ADD (FAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_OTHERINBILLENTRY', 'FENTRYDC', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_OTHERINBILLENTRY', 'FUNITRATE', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_OTHERINBILLENTRY', 'FINVUNITID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop TABLE --------- 请认真检查该脚本 ------------------- 
IF EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_IM_INTERORGSETTLECFG') 
 DROP TABLE T_IM_INTERORGSETTLECFG;

 --- drop TABLE --------- 请认真检查该脚本 ------------------- 
IF EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_IM_SETTLERELATIONS_L') 
 DROP TABLE T_IM_SETTLERELATIONS_L;

 --- drop TABLE --------- 请认真检查该脚本 ------------------- 
IF EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_IM_SETTLERELATIONDETAIL') 
 DROP TABLE T_IM_SETTLERELATIONDETAIL;

 --- drop TABLE --------- 请认真检查该脚本 ------------------- 
IF EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_IM_SETTLERELATIONS') 
 DROP TABLE T_IM_SETTLERELATIONS;

 --- drop TABLE --------- 请认真检查该脚本 ------------------- 
IF EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_IM_INTERORGPRICE') 
 DROP TABLE T_IM_INTERORGPRICE;

 --- drop TABLE --------- 请认真检查该脚本 ------------------- 
IF EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_IM_INTERORGPRICE_L') 
 DROP TABLE T_IM_INTERORGPRICE_L;

 --- drop TABLE --------- 请认真检查该脚本 ------------------- 
IF EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_IM_INTERORGPRICEINFO') 
 DROP TABLE T_IM_INTERORGPRICEINFO;


/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\IM_table.sql **/
