/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TSRBD_constraint.sql **/
 EXEC P_ALTERPK 'PK_TSRBD_AUTORULES', 'T_TSRBD_AUTORULES', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TSRBD_AUTORULES') CREATE INDEX IDX_TSRBD_AUTORULES ON T_TSRBD_AUTORULES ( FNUMBER );


 EXEC P_ALTERPK 'PK_TSRBD_AUTORULES_L', 'T_TSRBD_AUTORULES_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_TSRBD_OPERATMANAGE', 'T_TSRBD_OPERATMANAGE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TSRBD_OPERATMANAGE') CREATE INDEX IDX_TSRBD_OPERATMANAGE ON T_TSRBD_OPERATMANAGE ( FNUMBER );


 EXEC P_ALTERPK 'PK_TSRBD_OPERATMANAGE_L', 'T_TSRBD_OPERATMANAGE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_TSRBD_PARENTRYENTITY', 'T_TSRBD_PARENTRYENTITY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_TSRBD_PARENTRYENTITY_L', 'T_TSRBD_PARENTRYENTITY_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TSRBD_PARENTRYENTITY_L') CREATE INDEX IDX_TSRBD_PARENTRYENTITY_L ON T_TSRBD_PARENTRYENTITY_L ( FENTRYID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_TSRBD_PLUGENTRYENTITY', 'T_TSRBD_PLUGENTRYENTITY', 'FENTRYID', '1';

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



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