/**Begin D:\文档\DBA\PDM_UPGRADE\pdm1\SYS_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_SVC_PARAMETERCOPY', 'T_SVC_PARAMETERCOPY', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_SVC_PARAMETERCOPY_L', 'T_SVC_PARAMETERCOPY_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_SVC_PARAMCOPY_TARGETORG', 'T_SVC_PARAMCOPY_TARGETORG', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_SVC_PARAMCOPY_DETAIL', 'T_SVC_PARAMCOPY_DETAIL', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_SVC_PARAMCOPY_APP', 'T_SVC_PARAMCOPY_APP', 'FPKID', '1';

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

 EXEC P_ALTERPK 'PK_T_SVC_PARAMCOPY_RESULT', 'T_SVC_PARAMCOPY_RESULT', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_SVC_PARAMCOPY_RESULT' AND KSQL_INDNAME = 'IDX_T_SVC_PARAMCOPY_RESULT') CREATE UNIQUE  CLUSTERED INDEX IDX_T_SVC_PARAMCOPY_RESULT ON T_SVC_PARAMCOPY_RESULT ( FBILLNO );


 EXEC P_ALTERPK 'PK_T_SVC_PARAMCOPY_RES_TORG', 'T_SVC_PARAMCOPY_RES_TORG', 'FPKID', '1';

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


/**End D:\文档\DBA\PDM_UPGRADE\pdm1\SYS_constraint.sql **/
