/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MDS_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_MDS_WEEKROLL_L', 'T_MDS_WEEKROLL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_MDS_WEEKROLLENTA', 'T_MDS_WEEKROLLENTA', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_MDS_WEEKROLLENTB', 'T_MDS_WEEKROLLENTB', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_MDS_FCDATADTLENTBK', 'T_MDS_FCDATADTLENTBK', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_FCDATADTLENTBK') CREATE INDEX IDX_MDS_FCDATADTLENTBK ON T_MDS_FCDATADTLENTBK ( FID ,FSEQ );
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_FCDATADTLENTBKWR') CREATE INDEX IDX_MDS_FCDATADTLENTBKWR ON T_MDS_FCDATADTLENTBK ( FWEEKROLLID );


 EXEC P_ALTERPK 'PK_T_MDS_WEEKROLLLOG', 'T_MDS_WEEKROLLLOG', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_MDS_WEEKROLL', 'T_MDS_WEEKROLL', 'FID', '1';

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

 EXEC P_ALTERPK 'PK_MDS_EXECTASKX', 'T_MDS_EXECTASKX', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_MDS_EXECTASKX') CREATE INDEX IDX_T_MDS_EXECTASKX ON T_MDS_EXECTASKX ( FBILLNO  );


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