IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FA_EXTERNALCONFIG') 
 CREATE TABLE T_FA_EXTERNALCONFIG (
FID BIGINT DEFAULT 0 NOT NULL,
FCLOUDID VARCHAR(50) DEFAULT ' ' NOT NULL,
FAPPID VARCHAR(50) DEFAULT ' ' NOT NULL,
FSERVICENAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FMETHODNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FTEXT NVARCHAR(100) DEFAULT ' ' NOT NULL
);

 EXEC P_ALTERPK 'PK_T_FA_EXTERNALCONFIG', 'T_FA_EXTERNALCONFIG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_EXTERANLCONFIG') CREATE INDEX IDX_FA_EXTERANLCONFIG ON T_FA_EXTERNALCONFIG ( FCLOUDID ,FAPPID );