/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\EB_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_EB_DATASET', 'T_EB_DATASET', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_DATASET_MODEL') CREATE INDEX IDX_EB_DATASET_MODEL ON T_EB_DATASET ( FMODEL );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_DATASET_CATALOG') CREATE INDEX IDX_EB_DATASET_CATALOG ON T_EB_DATASET ( FCATALOG );


 EXEC P_ALTERPK 'PK_T_EB_DATASETCATALOG', 'T_EB_DATASETCATALOG', 'FID', '1';


 EXEC P_ALTERPK 'PK_T_EB_DATASETCATALOG_L', 'T_EB_DATASETCATALOG_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_DATASETCATALOG_L') CREATE INDEX IDX_EB_DATASETCATALOG_L ON T_EB_DATASETCATALOG_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_EB_DATASETDIM', 'T_EB_DATASETDIM', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_DATASETDIM_FID') CREATE INDEX IDX_EB_DATASETDIM_FID ON T_EB_DATASETDIM ( FID );


 EXEC P_ALTERPK 'PK_T_EB_BIZRULEFORMULAACC', 'T_EB_BIZRULEFORMULAACC', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_BIZRULEACC_ACCID') CREATE INDEX IDX_EB_BIZRULEACC_ACCID ON T_EB_BIZRULEFORMULAACC ( FACCOUNTID );


 EXEC P_ALTERPK 'PK_T_EB_BIZRULESET', 'T_EB_BIZRULESET', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_BIZRULESET_MODEL') CREATE INDEX IDX_EB_BIZRULESET_MODEL ON T_EB_BIZRULESET ( FMODEL );


 EXEC P_ALTERPK 'PK_T_EB_VARMANAGEMENT', 'T_EB_VARMANAGEMENT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_VARMANAGE_TYPE') CREATE INDEX IDX_EB_VARMANAGE_TYPE ON T_EB_VARMANAGEMENT ( FVARTYPE );


 EXEC P_ALTERPK 'PK_T_EB_VARMANAGEMENTENTITY', 'T_EB_VARMANAGEMENTENTITY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_VARMANENTITY_DIM') CREATE INDEX IDX_EB_VARMANENTITY_DIM ON T_EB_VARMANAGEMENTENTITY ( FDIMENSION );



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\EB_constraint.sql **/
