/** HW项目标准产品合并 标准产品升级脚本 **/
 EXEC P_ALTERPK 'PK_HBSS_FAMILYMEMBERREL_L', 'T_HBSS_FAMILYMEMBERREL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_LANGUAGECERT_L', 'T_HBSS_LANGUAGECERT_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_LANGUAGETYPE_L', 'T_HBSS_LANGUAGETYPE_L', 'FPKID', '1';

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

 EXEC P_ALTERPK 'PK_HBSS_ADDRESSTYPE_L', 'T_HBSS_ADDRESSTYPE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_SEX_L', 'T_HBSS_SEX_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_ADDRESSTYPE', 'T_HBSS_ADDRESSTYPE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_LANGUAGECERT', 'T_HBSS_LANGUAGECERT', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_LANGUAGETYPE', 'T_HBSS_LANGUAGETYPE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_FAMILYMEMBERREL', 'T_HBSS_FAMILYMEMBERREL', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_SEX', 'T_HBSS_SEX', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_SERVICERTYPEIFIELD', 'T_HBSS_SERVICERTYPEIFIELD', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_WORKPLACE', 'T_HBSS_WORKPLACE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_WORKPLACE_L', 'T_HBSS_WORKPLACE_L', 'FPKID', '1';

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

 EXEC P_ALTERPK 'PK_HBSS_EMERGCONTACTYPE', 'T_HBSS_EMERGCONTACTYPE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_EMERGCONTACTYPE_L', 'T_HBSS_EMERGCONTACTYPE_L', 'FPKID', '1';

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

 EXEC P_ALTERPK 'PK_HBSS_LABORRELSUB', 'T_HBSS_LABORRELSUB', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_LABORRELSUB_ENTRY', 'T_HBSS_LABORRELSUB_ENTRY', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HBSS_LABORRELSUB_ENTRY') CREATE INDEX IDX_HBSS_LABORRELSUB_ENTRY ON T_HBSS_LABORRELSUB_ENTRY ( FID ,FBASEDATAID );


 EXEC P_ALTERPK 'PK_HBSS_LABORRELSUB_L', 'T_HBSS_LABORRELSUB_L', 'FPKID', '1';

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

 EXEC P_ALTERPK 'PK_HBSS_MANAGINGSCOPE', 'T_HBSS_MANAGINGSCOPE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_MANAGINGSCOPE_L', 'T_HBSS_MANAGINGSCOPE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_COMPANYSCALE', 'T_HBSS_COMPANYSCALE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_COMPANYSCALE_L', 'T_HBSS_COMPANYSCALE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_PATENTSCATEGORY', 'T_HBSS_PATENTSCATEGORY', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_PATENTSCATEGORY_L', 'T_HBSS_PATENTSCATEGORY_L', 'FPKID', '1';

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