/**Begin**/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_PERMCONTROLDIM') 
 CREATE TABLE T_EB_PERMCONTROLDIM (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FPERMCONTROLDIM VARCHAR(300) DEFAULT ' ' NOT NULL
);

EXEC P_ALTERPK 'PK_T_EB_PERMCONTROLDIM', 'T_EB_PERMCONTROLDIM', 'FID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_PERMCONTROLDIM_FMODELID') CREATE INDEX IDX_EB_PERMCONTROLDIM_FMODELID ON T_EB_PERMCONTROLDIM ( FMODELID );

/**End**/