/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MDL_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BAS_KINGSCRIPTLIB', 'T_BAS_KINGSCRIPTLIB', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_BAS_KINGSCRIPTLIB_L', 'T_BAS_KINGSCRIPTLIB_L', 'FPKID', '1';

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



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