/**Begin D:\scm_code\dev_scm\dbschema\imc\1.5\main\rim\pdm\20210616\RIM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_AIR' AND KSQL_COL_NAME ='FAWS_SERIAL_NO') 
 ALTER TABLE T_RIM_INV_AIR ADD (FAWS_SERIAL_NO NVARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_CUSTOM' AND KSQL_COL_NAME ='FAWS_SERIAL_NO') 
 ALTER TABLE T_RIM_INV_CUSTOM ADD (FAWS_SERIAL_NO NVARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_GENERAL' AND KSQL_COL_NAME ='FAWS_SERIAL_NO') 
 ALTER TABLE T_RIM_INV_GENERAL ADD (FAWS_SERIAL_NO NVARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_MOTOR' AND KSQL_COL_NAME ='FAWS_SERIAL_NO') 
 ALTER TABLE T_RIM_INV_MOTOR ADD (FAWS_SERIAL_NO NVARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ORDINARY' AND KSQL_COL_NAME ='FAWS_SERIAL_NO') 
 ALTER TABLE T_RIM_INV_ORDINARY ADD (FAWS_SERIAL_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 ='FAWS_SERIAL_NO') 
 ALTER TABLE T_RIM_INV_OTHER ADD (FAWS_SERIAL_NO NVARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_QUOTA' AND KSQL_COL_NAME ='FAWS_SERIAL_NO') 
 ALTER TABLE T_RIM_INV_QUOTA ADD (FAWS_SERIAL_NO NVARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_SPECIAL' AND KSQL_COL_NAME ='FAWS_SERIAL_NO') 
 ALTER TABLE T_RIM_INV_SPECIAL ADD (FAWS_SERIAL_NO NVARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_TAX_PROOF' AND KSQL_COL_NAME ='FAWS_SERIAL_NO') 
 ALTER TABLE T_RIM_INV_TAX_PROOF ADD (FAWS_SERIAL_NO NVARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_TAXI' AND KSQL_COL_NAME ='FAWS_SERIAL_NO') 
 ALTER TABLE T_RIM_INV_TAXI ADD (FAWS_SERIAL_NO NVARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_TOLL' AND KSQL_COL_NAME ='FAWS_SERIAL_NO') 
 ALTER TABLE T_RIM_INV_TOLL ADD (FAWS_SERIAL_NO NVARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_TRAIN' AND KSQL_COL_NAME ='FAWS_SERIAL_NO') 
 ALTER TABLE T_RIM_INV_TRAIN ADD (FAWS_SERIAL_NO NVARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_TRANSPORT' AND KSQL_COL_NAME ='FAWS_SERIAL_NO') 
 ALTER TABLE T_RIM_INV_TRANSPORT ADD (FAWS_SERIAL_NO NVARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_USEDCAR' AND KSQL_COL_NAME ='FAWS_SERIAL_NO') 
 ALTER TABLE T_RIM_INV_USEDCAR ADD (FAWS_SERIAL_NO NVARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INVOICE' AND KSQL_COL_NAME ='FAWS_SERIAL_NO') 
 ALTER TABLE T_RIM_INVOICE ADD (FAWS_SERIAL_NO NVARCHAR(36) DEFAULT ' ' NOT NULL );

/**End D:\scm_code\dev_scm\dbschema\imc\1.5\main\rim\pdm\20210616\RIM_table.sql **/
