/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SBD_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_MATERIALSALINFO' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_BD_MATERIALSALINFO ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_MATERIALPURINFO' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_BD_MATERIALPURINFO ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_RECCONDITION' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_BD_RECCONDITION ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_RECCONDITION' AND KSQL_COL_NAME ='FDESCRIPTION') 
 ALTER TABLE T_BD_RECCONDITION ADD (FDESCRIPTION NVARCHAR(255) DEFAULT ' ' );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_PAYCONDITION' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_BD_PAYCONDITION ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_PAYCONDITION' AND KSQL_COL_NAME ='FDESCRIPTION') 
 ALTER TABLE T_BD_PAYCONDITION ADD (FDESCRIPTION NVARCHAR(512) DEFAULT ' ' );
 EXEC p_AlterColumn 'T_BD_OPERATORGROUP', 'FNAME', 'NVARCHAR(255)', 'NULL', '0010', '';

 EXEC p_AlterColumn 'T_BD_OPERATORGROUP', 'FDESCRIPTION', 'NVARCHAR(255)', 'NULL', '0010', '';

 EXEC p_AlterColumn 'T_BD_OPERATORGROUPENTRY', 'FOPERATORNAME', 'NVARCHAR(255)', 'NULL', '0010', '';


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