IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_CALFORMULA' AND KSQL_COL_NAME IN ('FCONDITIONBILLID')) 
 ALTER TABLE T_PUR_CALFORMULA ADD (FCONDITIONBILLID VARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_CALFORMULA' AND KSQL_COL_NAME IN ('FCONDITIONFIELD')) 
 ALTER TABLE T_PUR_CALFORMULA ADD (FCONDITIONFIELD VARCHAR(100) DEFAULT ' ' NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_CAL_CONDIENTITY') 
 CREATE TABLE T_PUR_CAL_CONDIENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FCONDITIONNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FCONDITIONSCORE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCONDITIONID VARCHAR(50) DEFAULT '0' NOT NULL
);
