IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_UPDATEPARAMCONFIG') 
 CREATE TABLE T_PUR_UPDATEPARAMCONFIG (
FID BIGINT DEFAULT 0 NOT NULL,
FPARAMNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPARAMKEY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPARAMVALUE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPARAMMSG NVARCHAR(255) DEFAULT ' ' NOT NULL
);

EXEC P_ALTERPK 'PK_T_PUR_UPDATEPARAMCONFIG', 'T_PUR_UPDATEPARAMCONFIG', 'FID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_PUR_CONFIG_FPARAMKEY') CREATE INDEX T_PUR_CONFIG_FPARAMKEY ON T_PUR_UPDATEPARAMCONFIG ( FPARAMKEY );