我有richtextbox1 并想删除所有的“USER1”。从下面看,如果句子以 ALTER TABLE 开头并包含“USER1”。使用 C# 的最佳方法是什么
我在richtextbox 上的文字
DROP INDEX XIE2TBL_A;
DROP INDEX XPKTBL_A;
ALTER TABLE "COURSE" DROP CONSTRAINT "CRSE_CRSE_FK";
ALTER TABLE "ENROLLMENT" DROP CONSTRAINT "ENR_STU_FK";
ALTER TABLE "ENROLLMENT" DROP CONSTRAINT "ENR_SECT_FK";
ALTER TABLE "ENROLLMENT" ADD CONSTRAINT "ENR_STU_FK" FOREIGN KEY ("STUDENT_ID") REFERENCES "USER1"."STUDENT"("STUDENT_ID") ENABLE;
ALTER TABLE "ENROLLMENT" ADD CONSTRAINT "ENR_SECT_FK" FOREIGN KEY ("SECTION_ID") REFERENCES "USER1"."SECTION"("SECTION_ID") ENABLE;
ALTER TABLE "GRADE" DROP CONSTRAINT "GR_ENR_FK";
ALTER TABLE "GRADE" DROP CONSTRAINT "GR_GRTW_FK";
ALTER TABLE "GRADE" ADD CONSTRAINT "GR_ENR_FK" FOREIGN KEY ("STUDENT_ID","SECTION_ID") REFERENCES "USER1"."ENROLLMENT"("STUDENT_ID","SECTION_ID") ENABLE;
ALTER TABLE "GRADE" ADD CONSTRAINT "GR_GRTW_FK" FOREIGN KEY ("SECTION_ID","GRADE_TYPE_CODE") REFERENCES "USER1"."GRADE_TYPE_WEIGHT"("SECTION_ID","GRADE_TYPE_CODE") ENABLE;
ALTER TABLE "GRADE_TYPE_WEIGHT" DROP CONSTRAINT "GRTW_GRTYP_FK";
ALTER TABLE "GRADE_TYPE_WEIGHT" DROP CONSTRAINT "GRTW_SECT_FK";
ALTER TABLE "GRADE_TYPE_WEIGHT" ADD CONSTRAINT "GRTW_GRTYP_FK" FOREIGN KEY ("GRADE_TYPE_CODE") REFERENCES "USER1"."GRADE_TYPE"("GRADE_TYPE_CODE") ENABLE;
ALTER TABLE "GRADE_TYPE_WEIGHT" ADD CONSTRAINT "GRTW_SECT_FK" FOREIGN KEY ("SECTION_ID") REFERENCES "USER1"."SECTION"("SECTION_ID") ENABLE;
ALTER TABLE "INSTRUCTOR" DROP CONSTRAINT "INST_ZIP_FK";
ALTER TABLE "INSTRUCTOR" ADD CONSTRAINT "INST_ZIP_FK" FOREIGN KEY ("ZIP") REFERENCES "USER1"."ZIPCODE"("ZIP") ENABLE;
ALTER TABLE "SECTION" DROP CONSTRAINT "SECT_INST_FK";
我要这个:
DROP INDEX XIE2TBL_A;
DROP INDEX XPKTBL_A;
ALTER TABLE "COURSE" DROP CONSTRAINT "CRSE_CRSE_FK";
ALTER TABLE "ENROLLMENT" DROP CONSTRAINT "ENR_STU_FK";
ALTER TABLE "ENROLLMENT" DROP CONSTRAINT "ENR_SECT_FK";
ALTER TABLE "ENROLLMENT" ADD CONSTRAINT "ENR_STU_FK" FOREIGN KEY ("STUDENT_ID") REFERENCES "STUDENT"("STUDENT_ID") ENABLE;
ALTER TABLE "ENROLLMENT" ADD CONSTRAINT "ENR_SECT_FK" FOREIGN KEY ("SECTION_ID") REFERENCES "SECTION"("SECTION_ID") ENABLE;
ALTER TABLE "GRADE" DROP CONSTRAINT "GR_ENR_FK";
ALTER TABLE "GRADE" DROP CONSTRAINT "GR_GRTW_FK";
ALTER TABLE "GRADE" ADD CONSTRAINT "GR_ENR_FK" FOREIGN KEY ("STUDENT_ID","SECTION_ID") REFERENCES "ENROLLMENT"("STUDENT_ID","SECTION_ID") ENABLE;
ALTER TABLE "GRADE" ADD CONSTRAINT "GR_GRTW_FK" FOREIGN KEY ("SECTION_ID","GRADE_TYPE_CODE") REFERENCES "GRADE_TYPE_WEIGHT"("SECTION_ID","GRADE_TYPE_CODE") ENABLE;
ALTER TABLE "GRADE_TYPE_WEIGHT" DROP CONSTRAINT "GRTW_GRTYP_FK";
ALTER TABLE "GRADE_TYPE_WEIGHT" DROP CONSTRAINT "GRTW_SECT_FK";
ALTER TABLE "GRADE_TYPE_WEIGHT" ADD CONSTRAINT "GRTW_GRTYP_FK" FOREIGN KEY ("GRADE_TYPE_CODE") REFERENCES "GRADE_TYPE"("GRADE_TYPE_CODE") ENABLE;
ALTER TABLE "GRADE_TYPE_WEIGHT" ADD CONSTRAINT "GRTW_SECT_FK" FOREIGN KEY ("SECTION_ID") REFERENCES "SECTION"("SECTION_ID") ENABLE;
ALTER TABLE "INSTRUCTOR" DROP CONSTRAINT "INST_ZIP_FK";
ALTER TABLE "INSTRUCTOR" ADD CONSTRAINT "INST_ZIP_FK" FOREIGN KEY ("ZIP") REFERENCES "ZIPCODE"("ZIP") ENABLE;
ALTER TABLE "SECTION" DROP CONSTRAINT "SECT_INST_FK";