The following script can be used to clear the TConnectEDI837P database. It should only be used in a non-production environment as it will delete all professional claim files processed in the TConnectEDI837P database. The How to Clear the Tctep Database article details the process to clear the TctepDb database, and in turn removing traces of the file's history from the Gateway Portal.
Note: the script may need to be executed multiple times to clear all tables due to key constraints
Use TConnectEDI837P GO DELETE FROM dbo.OutboundStage_Step5 DELETE FROM dbo.OutboundStage_Step4 DELETE FROM dbo.OutboundStage_Step3 DELETE FROM dbo.OutboundStage_Step2 DELETE FROM dbo.OutboundStage_Log DELETE FROM dbo.OutboundStage DELETE FROM dbo.Outbound_Sequence DELETE FROM EDI837P.EDI837P_L2440_FRM_SupportingDocumentation DELETE FROM EDI837P.EDI837P_L2440_Loop DELETE FROM EDI837P.EDI837P_L2430_CAS_LineAdjustment DELETE FROM EDI837P.EDI837P_L2430_Loop DELETE FROM EDI837P.EDI837P_L2420F_REF_ReferringProviderSecondaryIdentification DELETE FROM EDI837P.EDI837P_L2420F_Loop DELETE FROM EDI837P.EDI837P_L2420E_REF_OrderingProviderSecondaryIdentification DELETE FROM EDI837P.EDI837P_L2420D_REF_SupervisingProviderSecondaryIdentification DELETE FROM EDI837P.EDI837P_L2420C_REF_ServiceFacilityLocationSecondaryIdentification DELETE FROM EDI837P.EDI837P_L2420B_REF_PurchasedServiceProviderSecondaryIdentification DELETE FROM EDI837P.EDI837P_L2420A_REF_RenderingProviderSecondaryIdentification DELETE FROM EDI837P.EDI837P_L2400_REF_ReferralNumber DELETE FROM EDI837P.EDI837P_L2400_REF_PriorAuthorization DELETE FROM EDI837P.EDI837P_L2400_PWK_LineSupplementalInformation DELETE FROM EDI837P.EDI837P_L2400_MEA_TestResult DELETE FROM EDI837P.EDI837P_L2400_K3_FileInformation DELETE FROM EDI837P.EDI837P_L2400_DTP_Date_TestDate DELETE FROM EDI837P.EDI837P_L2400_CRC_AmbulanceCertification DELETE FROM EDI837P.EDI837P_L2400_Loop DELETE FROM EDI837P.EDI837P_L2330G_REF_OtherPayerBillingProviderSecondaryIdentification DELETE FROM EDI837P.EDI837P_L2330F_REF_OtherPayerSupervisingProviderSecondaryIdentification DELETE FROM EDI837P.EDI837P_L2330E_REF_OtherPayerServiceFacilityLocationSecondaryIdentification DELETE FROM EDI837P.EDI837P_L2330D_REF_OtherPayerRenderingProviderSecondaryIdentification DELETE FROM EDI837P.EDI837P_L2330C_REF_OtherPayerReferringProviderSecondaryIdentification DELETE FROM EDI837P.EDI837P_L2330C_Loop DELETE FROM EDI837P.EDI837P_L2330B_REF_OtherPayerSecondaryIdentifier DELETE FROM EDI837P.EDI837P_L2320_CAS_ClaimLevelAdjustments DELETE FROM EDI837P.EDI837P_L2320_Loop DELETE FROM EDI837P.EDI837P_L2310D_REF_SupervisingProviderSecondaryIdentification DELETE FROM EDI837P.EDI837P_L2310C_REF_ServiceFacilityLocationSecondaryIdentification DELETE FROM EDI837P.EDI837P_L2310B_REF_RenderingProviderSecondaryIdentification DELETE FROM EDI837P.EDI837P_L2310A_REF_ReferringProviderSecondaryIdentification DELETE FROM EDI837P.EDI837P_L2310A_Loop DELETE FROM EDI837P.EDI837P_L2300_PWK_ClaimSupplementalInformation DELETE FROM EDI837P.EDI837P_L2300_K3_FileInformation DELETE FROM EDI837P.EDI837P_L2300_HI_HealthCareDiagnosisCode DELETE FROM EDI837P.EDI837P_L2300_HI_ConditionInformation DELETE FROM EDI837P.EDI837P_L2300_HI_AnesthesiaRelatedProcedure DELETE FROM EDI837P.EDI837P_L2300_DTP_Date_AssumedandRelinquishedCareDates DELETE FROM EDI837P.EDI837P_L2300_CRC_PatientConditionInformation_Vision DELETE FROM EDI837P.EDI837P_L2300_CRC_AmbulanceCertification DELETE FROM EDI837P.EDI837P_L2300_Loop DELETE FROM EDI837P.EDI837P_L2010CA_DMG05_CompositeRaceorEthnicityInformation DELETE FROM EDI837P.EDI837P_L2010BB_REF_PayerSecondaryIdentification DELETE FROM EDI837P.EDI837P_L2010BB_REF_BillingProviderSecondaryIdentification DELETE FROM EDI837P.EDI837P_L2010BA_DMG05_CompositeRaceorEthnicityInformation DELETE FROM EDI837P.EDI837P_L2010AA_REF_BillingProviderUPIN_LicenseInformation DELETE FROM EDI837P.EDI837P_L2010AA_PER_BillingProviderContactInformation DELETE FROM EDI837P.EDI837P_L2000C_Loop DELETE FROM EDI837P.EDI837P_L2000B_Loop DELETE FROM EDI837P.EDI837P_L2300_ClaimLookup DELETE FROM EDI837P.EDI837P_L1000A_PER_SubmitterEDIContactInformation DELETE FROM EDI837P.EDI837P_L2000A_Loop DELETE FROM EDI837P.EDI837P_L1000_Loop DELETE FROM EDI837P.EDIFileInformation