/**Begin C:\PDM_UPGRADE\PDM1\PUR_table.sql **/
 EXEC p_AlterColumn 'T_PUR_PAY_L', 'FREMARK', 'NVARCHAR(512)', 'NOT NULL', '0100', ''' ''';

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

 EXEC p_AlterColumn 'T_PUR_INVOICENTRY2', 'FNOTE', 'NVARCHAR(512)', 'NOT NULL', '0100', ''' ''';
 
  EXEC p_AlterColumn 'T_PUR_SALRETURN_L', 'FREMARK', 'NVARCHAR(512)', 'NOT NULL', '0100', ''' ''';

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

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

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

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

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INSTOCKENTRY_A' AND KSQL_COL_NAME IN ('FSUMINVOICEQTY')) 
 ALTER TABLE T_PUR_INSTOCKENTRY_A ADD (FSUMINVOICEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INSTOCKENTRY_A' AND KSQL_COL_NAME IN ('FSUMINVOICEAMT')) 
 ALTER TABLE T_PUR_INSTOCKENTRY_A ADD (FSUMINVOICEAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );

/**End C:\PDM_UPGRADE\PDM1\PUR_table.sql **/
