/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\PUR_table.sql **/
 EXEC p_AlterColumn 'T_PUR_QUOTE_L', 'FREMARK', 'NVARCHAR(512)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_PUR_ORDER_L', 'FREMARK', 'NVARCHAR(512)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_PUR_INQUIRYENTRY', 'FNOTE', 'NVARCHAR(512)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_PUR_QUOTENTRY', 'FNOTE', 'NVARCHAR(512)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_PUR_ORDERENTRY', 'FNOTE', 'NVARCHAR(512)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_PUR_COMPARENTRY', 'FNOTE', 'NVARCHAR(512)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_PUR_BIDBILLENTRY', 'FNOTE', 'NVARCHAR(512)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_PUR_COMPARE_L', 'FREMARK', 'NVARCHAR(512)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_PUR_INQUIRY_L', 'FREMARK', 'NVARCHAR(512)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_PUR_BIDBILL_L', 'FREMARK', 'NVARCHAR(512)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_PUR_REQUEST_L', 'FREMARK', 'NVARCHAR(512)', 'NOT NULL', '0100', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDCHANGE' AND KSQL_COL_NAME ='FREASON') 
 ALTER TABLE T_PUR_ORDCHANGE ADD (FREASON NVARCHAR(512) DEFAULT ' ' );
 EXEC p_AlterColumn 'T_PUR_REQUESTENTRY', 'FNOTE', 'NVARCHAR(512)', 'NOT NULL', '0100', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REQUESTENTRY' AND KSQL_COL_NAME ='FPURTYPEID') 
 ALTER TABLE T_PUR_REQUESTENTRY ADD (FPURTYPEID BIGINT DEFAULT 0 NOT NULL );

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