/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\HPDI_table.sql **/
 EXEC p_AlterColumn 'T_HPDI_TASKCENTER', 'FEXECUTEFAILMSG', 'NVARCHAR(2000)', 'NOT NULL', '0100', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HPDI_TASKCENTER_L' AND KSQL_COL_NAME ='FID') 
 ALTER TABLE T_HPDI_TASKCENTER_L ADD (FID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HPDI_BUVALUECONFIG' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_HPDI_BUVALUECONFIG ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HPDI_BUVALUECONFIG' AND KSQL_COL_NAME ='FSIMPLENAME') 
 ALTER TABLE T_HPDI_BUVALUECONFIG ADD (FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HPDI_BUVALUECONFIG' AND KSQL_COL_NAME ='FDESCRIPTION') 
 ALTER TABLE T_HPDI_BUVALUECONFIG ADD (FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HPDI_TASKRULE' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_HPDI_TASKRULE ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HPDI_TASKRULE' AND KSQL_COL_NAME ='FSIMPLENAME') 
 ALTER TABLE T_HPDI_TASKRULE ADD (FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HPDI_TASKRULE' AND KSQL_COL_NAME ='FDESCRIPTION') 
 ALTER TABLE T_HPDI_TASKRULE ADD (FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL );

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