/**Begin D:\PDM_UPGRADE\PDM1\EB_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_COSTTYPE' AND KSQL_COL_NAME IN ('ENTITY')) 
 ALTER TABLE T_EB_COSTTYPE ADD (ENTITY NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_COSTTYPE' AND KSQL_COL_NAME IN ('YEAR')) 
 ALTER TABLE T_EB_COSTTYPE ADD (YEAR NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_COSTTYPE' AND KSQL_COL_NAME IN ('CURRENCY')) 
 ALTER TABLE T_EB_COSTTYPE ADD (CURRENCY NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_COSTTYPE' AND KSQL_COL_NAME IN ('PERIOD')) 
 ALTER TABLE T_EB_COSTTYPE ADD (PERIOD NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_COSTTYPE' AND KSQL_COL_NAME IN ('VERSION')) 
 ALTER TABLE T_EB_COSTTYPE ADD (VERSION NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_COSTTYPE' AND KSQL_COL_NAME IN ('ENTITYRANG')) 
 ALTER TABLE T_EB_COSTTYPE ADD (ENTITYRANG NVARCHAR(510) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_COSTTYPE' AND KSQL_COL_NAME IN ('YEARRANG')) 
 ALTER TABLE T_EB_COSTTYPE ADD (YEARRANG NVARCHAR(510) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_COSTTYPE' AND KSQL_COL_NAME IN ('PERIODRANG')) 
 ALTER TABLE T_EB_COSTTYPE ADD (PERIODRANG NVARCHAR(510) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_COSTTYPE' AND KSQL_COL_NAME IN ('VERSIONRANG')) 
 ALTER TABLE T_EB_COSTTYPE ADD (VERSIONRANG NVARCHAR(510) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_COSTTYPE' AND KSQL_COL_NAME IN ('CURRENCYRANG')) 
 ALTER TABLE T_EB_COSTTYPE ADD (CURRENCYRANG NVARCHAR(510) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_COSTTYPE' AND KSQL_COL_NAME IN ('ENTITYRANG_TAG')) 
 ALTER TABLE T_EB_COSTTYPE ADD (ENTITYRANG_TAG NCLOB );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_COSTTYPE' AND KSQL_COL_NAME IN ('YEARRANG_TAG')) 
 ALTER TABLE T_EB_COSTTYPE ADD (YEARRANG_TAG NCLOB );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_COSTTYPE' AND KSQL_COL_NAME IN ('PERIODRANG_TAG')) 
 ALTER TABLE T_EB_COSTTYPE ADD (PERIODRANG_TAG NCLOB );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_COSTTYPE' AND KSQL_COL_NAME IN ('VERSIONRANG_TAG')) 
 ALTER TABLE T_EB_COSTTYPE ADD (VERSIONRANG_TAG NCLOB );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_COSTTYPE' AND KSQL_COL_NAME IN ('CURRENCYRANG_TAG')) 
 ALTER TABLE T_EB_COSTTYPE ADD (CURRENCYRANG_TAG NCLOB );

/**End D:\PDM_UPGRADE\PDM1\EB_table.sql **/
