/**Begin D:\Soft\PDM_UPGRADE_1.4\PDM_UPGRADE\PDM1\HBSS_constraint.sql **/
/**援建类型、轮岗类型、挂职类型索引语句**/
EXEC P_ALTERPK 'PK_HBSS_ROTATIONTYPE', 'T_HBSS_ROTATIONTYPE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HBSS_ROTATIONTYPE' AND KSQL_INDNAME = 'IDX_HBSS_ROTATIONTYPE_NUMBER') CREATE INDEX IDX_HBSS_ROTATIONTYPE_NUMBER ON T_HBSS_ROTATIONTYPE ( FNUMBER );


EXEC P_ALTERPK 'PK_HBSS_ROTATIONTYPE_L', 'T_HBSS_ROTATIONTYPE_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HBSS_ROTATIONTYPE_L' AND KSQL_INDNAME = 'IDX_HBSS_ROTATIONTYPE_L') CREATE INDEX IDX_HBSS_ROTATIONTYPE_L ON T_HBSS_ROTATIONTYPE_L ( FID ,FLOCALEID );


EXEC P_ALTERPK 'PK_HBSS_TTAKEPOSTYPE', 'T_HBSS_TTAKEPOSTYPE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HBSS_TTAKEPOSTYPE' AND KSQL_INDNAME = 'IDX_HBSS_TTAKEPOSTYPE_NUMBER') CREATE INDEX IDX_HBSS_TTAKEPOSTYPE_NUMBER ON T_HBSS_TTAKEPOSTYPE ( FNUMBER );


EXEC P_ALTERPK 'PK_HBSS_TTAKEPOSTYPE_L', 'T_HBSS_TTAKEPOSTYPE_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HBSS_TTAKEPOSTYPE_L' AND KSQL_INDNAME = 'IDX_HBSS_TTAKEPOSTYPE_L') CREATE INDEX IDX_HBSS_TTAKEPOSTYPE_L ON T_HBSS_TTAKEPOSTYPE_L ( FID ,FLOCALEID );


EXEC P_ALTERPK 'PK_HBSS_HELPBUILDTYPE', 'T_HBSS_HELPBUILDTYPE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HBSS_HELPBUILDTYPE' AND KSQL_INDNAME = 'IDX_HBSS_HELPBUILDTYPE_NUMBER') CREATE INDEX IDX_HBSS_HELPBUILDTYPE_NUMBER ON T_HBSS_HELPBUILDTYPE ( FNUMBER );


EXEC P_ALTERPK 'PK_HBSS_HELPBUILDTYPE_L', 'T_HBSS_HELPBUILDTYPE_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HBSS_HELPBUILDTYPE_L' AND KSQL_INDNAME = 'IDX_HBSS_HELPBUILDTYPE_L') CREATE INDEX IDX_HBSS_HELPBUILDTYPE_L ON T_HBSS_HELPBUILDTYPE_L ( FID ,FLOCALEID );



/**End D:\Soft\PDM_UPGRADE_1.4\PDM_UPGRADE\PDM1\HBSS_constraint.sql **/
