/**Begin D:\pdm\PDM_UPGRADE\pdm_new\RIM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_OTHER' AND KSQL_COL_NAME ='FINVOICE_CODE') 
 ALTER TABLE T_RIM_INV_OTHER ADD (FINVOICE_CODE NVARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_OTHER' AND KSQL_COL_NAME ='FINVOICE_NO') 
 ALTER TABLE T_RIM_INV_OTHER ADD (FINVOICE_NO NVARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_OTHER' AND KSQL_COL_NAME ='FINVOICE_DATE') 
 ALTER TABLE T_RIM_INV_OTHER ADD (FINVOICE_DATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INVOICE' AND KSQL_COL_NAME ='FPROXY_MARK') 
 ALTER TABLE T_RIM_INVOICE ADD (FPROXY_MARK NVARCHAR(4) DEFAULT '0' NOT NULL );
 EXEC p_AlterColumn 'T_RIM_DOWNLOAD_FILE', 'FFILEID', 'NVARCHAR(100)', 'NOT NULL', '0100', ''' ''';
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_OTHER' AND KSQL_COL_NAME ='FTITLE')
 ALTER TABLE T_RIM_INV_OTHER ADD (FTITLE NVARCHAR(200) DEFAULT ' ' );


/**End D:\pdm\PDM_UPGRADE\pdm_new\RIM_table.sql **/
