/**Begin D:\PDM_UPGRADE\PDM1\HAOS_constraint.sql **/
 EXEC P_ALTERPK 'PK_HAOS_CHANGESCENE', 'T_HAOS_CHANGESCENE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_CHANGESCENE_L', 'T_HAOS_CHANGESCENE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_CHANGEOPERAT', 'T_HAOS_CHANGEOPERAT', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_CHANGEOPERAT_L', 'T_HAOS_CHANGEOPERAT_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_CHANGESCENESUB', 'T_HAOS_CHANGESCENESUB', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_CHANGESCENESUB_L', 'T_HAOS_CHANGESCENESUB_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_CSCHANGEREASON', 'T_HAOS_CSCHANGEREASON', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_CSCHANGEOPERAT', 'T_HAOS_CSCHANGEOPERAT', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_CHANGETRANSUM', 'T_HAOS_CHANGETRANSUM', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_CHANGETRANSUM') CREATE INDEX IDX_HAOS_CHANGETRANSUM ON T_HAOS_CHANGETRANSUM ( FTARGETORGID );


 EXEC P_ALTERPK 'PK_HAOS_CHANGEOPERDETAIL', 'T_HAOS_CHANGEOPERDETAIL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_CHANGEOPERDETAIL') CREATE INDEX IDX_HAOS_CHANGEOPERDETAIL ON T_HAOS_CHANGEOPERDETAIL ( FORGID );


 EXEC P_ALTERPK 'PK_HAOS_CHANGETRANDETAIL', 'T_HAOS_CHANGETRANDETAIL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_CHANGETRANDETAIL') CREATE INDEX IDX_HAOS_CHANGETRANDETAIL ON T_HAOS_CHANGETRANDETAIL ( FTARGETORGID );


 EXEC P_ALTERPK 'PK_HAOS_CTSOURCEORG', 'T_HAOS_CTSOURCEORG', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_CTCHANGESCENESUB', 'T_HAOS_CTCHANGESCENESUB', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_CTDCHANGESCENESUB', 'T_HAOS_CTDCHANGESCENESUB', 'FPKID', '1';

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



/**End D:\PDM_UPGRADE\PDM1\HAOS_constraint.sql **/
