
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_LOG_SETTINGS')
 CREATE TABLE T_LOG_SETTINGS (
FID BIGINT DEFAULT 0 NOT NULL,
FUSERTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FOPUSERFORMAT VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATER BIGINT DEFAULT 0 NOT NULL,
FCREATEDATE DATETIME DEFAULT GETDATE(),
FMODIFIER BIGINT DEFAULT 0,
FMODIFYDATE DATETIME DEFAULT GETDATE()
);


 EXEC P_ALTERPK 'PK_T_LOG_SETTINGS', 'T_LOG_SETTINGS', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_LOG_SETTINGS_USERTYPE') CREATE INDEX IDX_T_LOG_SETTINGS_USERTYPE ON T_LOG_SETTINGS ( FUSERTYPE );


