/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SM_SALORDERENTRY_R' AND KSQL_COL_NAME ='FCONBILLENTITY') 
 ALTER TABLE T_SM_SALORDERENTRY_R ADD (FCONBILLENTITY VARCHAR(80) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SM_SALORDERENTRY_R' AND KSQL_COL_NAME ='FCONBILLNUMBER') 
 ALTER TABLE T_SM_SALORDERENTRY_R ADD (FCONBILLNUMBER NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SM_SALORDERENTRY_R' AND KSQL_COL_NAME ='FCONBILLID') 
 ALTER TABLE T_SM_SALORDERENTRY_R ADD (FCONBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SM_SALORDERENTRY_R' AND KSQL_COL_NAME ='FCONBILLENTRYID') 
 ALTER TABLE T_SM_SALORDERENTRY_R ADD (FCONBILLENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SM_SALORDERENTRY_R' AND KSQL_COL_NAME ='FCONBILLROWNUM') 
 ALTER TABLE T_SM_SALORDERENTRY_R ADD (FCONBILLROWNUM VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SM_SALORDERENTRY_R' AND KSQL_COL_NAME ='FCONBILLENTRYSEQ') 
 ALTER TABLE T_SM_SALORDERENTRY_R ADD (FCONBILLENTRYSEQ BIGINT DEFAULT 0 NOT NULL );

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