/**Begin D:\datamodel\imc\1.5\main\rim\pdm\20210604\RIM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ORDINARY' AND KSQL_COL_NAME ='FMAIN_GOODS_NAME') 
 ALTER TABLE T_RIM_INV_ORDINARY ADD (FMAIN_GOODS_NAME NVARCHAR(120) DEFAULT ' ' NOT NULL );
 EXEC p_AlterColumn 'T_RIM_INV_ORDINARY_ITEM', 'FSPEC_MODEL', 'NVARCHAR(100)', 'NOT NULL', '0100', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_SPECIAL' AND KSQL_COL_NAME ='FMAIN_GOODS_NAME') 
 ALTER TABLE T_RIM_INV_SPECIAL ADD (FMAIN_GOODS_NAME NVARCHAR(120) DEFAULT ' ' NOT NULL );
 EXEC p_AlterColumn 'T_RIM_INV_SPECIAL_ITEM', 'FSPEC_MODEL', 'NVARCHAR(100)', 'NOT NULL', '0100', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_TOLL' AND KSQL_COL_NAME ='FMAIN_GOODS_NAME') 
 ALTER TABLE T_RIM_INV_TOLL ADD (FMAIN_GOODS_NAME NVARCHAR(120) DEFAULT ' ' NOT NULL );
 EXEC p_AlterColumn 'T_RIM_INV_TOLL_ITEM', 'FSPEC_MODEL', 'NVARCHAR(100)', 'NOT NULL', '0100', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INVOICE' AND KSQL_COL_NAME ='FMAIN_GOODS_NAME') 
 ALTER TABLE T_RIM_INVOICE ADD (FMAIN_GOODS_NAME NVARCHAR(120) DEFAULT ' ' NOT NULL );

/**End D:\datamodel\imc\1.5\main\rim\pdm\20210604\RIM_table.sql **/
