IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_LIC_USERSYNFAILLOG') 
 CREATE TABLE T_LIC_USERSYNFAILLOG (
FID BIGINT DEFAULT 0 NOT NULL,
FUSERID BIGINT DEFAULT 0 NOT NULL,
FOPUSERID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FTYPE NVARCHAR(30) DEFAULT '1' NOT NULL,
FREASON NVARCHAR(255) DEFAULT ' ' NOT NULL
);


 EXEC P_ALTERPK 'PK_T_LIC_USERSYNFAILLOG', 'T_LIC_USERSYNFAILLOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_LIC_USER_FUSERID') CREATE INDEX IDX_T_LIC_USER_FUSERID ON T_LIC_USERSYNFAILLOG ( FUSERID );