/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\AI_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_AI_VCHBUILDSCH', 'T_AI_VCHBUILDSCH', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_AI_VCHBUILDSCH' AND KSQL_INDNAME = 'IDX_AI_VCHBUILDSCH_NAME') CREATE INDEX IDX_AI_VCHBUILDSCH_NAME ON T_AI_VCHBUILDSCH ( FSCHEMENAME );


 EXEC P_ALTERPK 'PK_T_AI_VCHBUILDSCHENTRY', 'T_AI_VCHBUILDSCHENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_AI_VCHBUILDSCHENTRY' AND KSQL_INDNAME = 'IDX_AI_VCHBUILDENTRY_FID') CREATE INDEX IDX_AI_VCHBUILDENTRY_FID ON T_AI_VCHBUILDSCHENTRY ( FID );


 EXEC P_ALTERPK 'PK_T_AI_VCHBUILDSCHSUB', 'T_AI_VCHBUILDSCHSUB', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_AI_VCHBUILDSCHSUB' AND KSQL_INDNAME = 'IDX_AI_VCHBUILDSUB_FENTRYID') CREATE INDEX IDX_AI_VCHBUILDSUB_FENTRYID ON T_AI_VCHBUILDSCHSUB ( FENTRYID );



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