/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SYS_constraint.sql **/


 EXEC P_ALTERPK 'PK_T_SVC_PRINTRESOURCE', 'T_SVC_PRINTRESOURCE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SVC_PRINTRESOURCE_N') CREATE INDEX IDX_SVC_PRINTRESOURCE_N ON T_SVC_PRINTRESOURCE ( FPRINTTPLID );


 EXEC P_ALTERPK 'PK_T_SVC_PRINTTPL', 'T_SVC_PRINTTPL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SVC_PRINTTPL_N') CREATE UNIQUE INDEX IDX_SVC_PRINTTPL_N ON T_SVC_PRINTTPL ( FNUMBER );


 EXEC P_ALTERPK 'PK_T_SVC_PRINTTPL_GROUP', 'T_SVC_PRINTTPL_GROUP', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SVC_PRINTTPL_GROUP_N') CREATE UNIQUE INDEX IDX_SVC_PRINTTPL_GROUP_N ON T_SVC_PRINTTPL_GROUP ( FNUMBER );


 EXEC P_ALTERPK 'PK_T_SVC_PRINTTPL_GROUP_L', 'T_SVC_PRINTTPL_GROUP_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_SVC_PRINTMETA', 'T_SVC_PRINTMETA', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SVC_PRINTMETA_N') CREATE UNIQUE INDEX IDX_SVC_PRINTMETA_N ON T_SVC_PRINTMETA ( FNUMBER );


 EXEC P_ALTERPK 'PK_T_SVC_PRINTMETA_L', 'T_SVC_PRINTMETA_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_SVC_PRINTTPL_L', 'T_SVC_PRINTTPL_L', 'FPKID', '1';

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



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