The following script can be used to clear the TConnectEDI837I database. It should only be used in a non-production environment as it will delete all claim files processed in the TConnectEDI837I 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 TConnectEDI837I; GO delete from EDI837I.EDI837I_L2430_CAS_LineAdjustment; delete from EDI837I.EDI837I_L2430_Loop; delete from EDI837I.EDI837I_L2420D_REF_ReferringProviderSecondaryIdentification; delete from EDI837I.EDI837I_L2420C_REF_RenderingProviderSecondaryIdentification; delete from EDI837I.EDI837I_L2420B_REF_OtherOperatingPhysicianSecondaryIdentification; delete from EDI837I.EDI837I_L2420A_REF_OperatingPhysicianSecondaryIdentification; delete from EDI837I.EDI837I_L2400_PWK_LineSupplementalInformation; delete from EDI837I.EDI837I_L2400_Loop; delete from EDI837I.EDI837I_L2330I_REF_OtherPayerBillingProviderSecondaryIdentifier; delete from EDI837I.EDI837I_L2330H_REF_OtherPayerReferringProviderSecondaryIdentification; delete from EDI837I.EDI837I_L2330G_REF_OtherPayerRenderingProviderSecondaryIdentifier; delete from EDI837I.EDI837I_L2330F_REF_OtherPayerServiceFacilityLocationSecondaryIdentification; delete from EDI837I.EDI837I_L2330E_REF_OtherPayerOtherOperatingPhysicianSecondaryIdentification; delete from EDI837I.EDI837I_L2330D_REF_OtherPayerOperatingPhysicianSecondaryIdentification; delete from EDI837I.EDI837I_L2330C_REF_OtherPayerAttendingProviderSecondaryIdentification; delete from EDI837I.EDI837I_L2330B_REF_OtherPayerSecondaryIdentifier; delete from EDI837I.EDI837I_L2330A_REF_OtherSubscriberSecondaryInformation; delete from EDI837I.EDI837I_L2320_CAS_ClaimLevelAdjustments; delete from EDI837I.EDI837I_L2320_Loop; delete from EDI837I.EDI837I_L2310F_REF_ReferringProviderSecondaryIdentification; delete from EDI837I.EDI837I_L2310E_REF_ServiceFacilitySecondaryIdentification; delete from EDI837I.EDI837I_L2310D_REF_RenderingProviderSecondaryIdentification; delete from EDI837I.EDI837I_L2310C_REF_OtherOperatingPhysicianSecondaryIdentification; delete from EDI837I.EDI837I_L2310B_REF_OperatingPhysicianSecondaryIdentification; delete from EDI837I.EDI837I_L2310A_REF_AttendingProviderSecondaryIdentification; delete from EDI837I.EDI837I_L2300_REF_InvestigationalDeviceExemptionNumber; delete from EDI837I.EDI837I_L2300_PWK_ClaimSupplementalInformation; delete from EDI837I.EDI837I_L2300_NTE_ClaimNote; delete from EDI837I.EDI837I_L2300_K3_FileInformation; delete from EDI837I.EDI837I_L2300_HI_ValueInformation; delete from EDI837I.EDI837I_L2300_HI_TreatmentCodeInformation; delete from EDI837I.EDI837I_L2300_HI_PrincipalProcedureInformation; delete from EDI837I.EDI837I_L2300_HI_PrincipalDiagnosis; delete from EDI837I.EDI837I_L2300_HI_Patient_sReasonForVisit; delete from EDI837I.EDI837I_L2300_HI_OtherProcedureInformation; delete from EDI837I.EDI837I_L2300_HI_OtherDiagnosisInformation; delete from EDI837I.EDI837I_L2300_HI_OccurrenceSpanInformation; delete from EDI837I.EDI837I_L2300_HI_OccurrenceInformation; delete from EDI837I.EDI837I_L2300_HI_ExternalCauseofInjury; delete from EDI837I.EDI837I_L2300_HI_DiagnosisRelatedGroup_DRG_Information; delete from EDI837I.EDI837I_L2300_HI_ConditionInformation; delete from EDI837I.EDI837I_L2300_HI_AdmittingDiagnosis; delete from EDI837I.EDI837I_L2300_Loop; delete from EDI837I.EDI837I_L2010CA_DMG05_CompositeRaceorEthnicityInformation; delete from EDI837I.EDI837I_L2010BB_REF_PayerSecondaryIdentification; delete from EDI837I.EDI837I_L2010BA_DMG05_CompositeRaceorEthnicityInformation; delete from EDI837I.EDI837I_L2010AA_PER_BillingProviderContactInformation; delete from EDI837I.EDI837I_L2000C_Loop; delete from EDI837I.EDI837I_L2000B_Loop; delete from EDI837I.EDI837I_L2300_ClaimLookup; delete from EDI837I.EDI837I_L2000A_Loop; delete from EDI837I.EDI837I_L1000A_PER_SubmitterEDIContactInformation; delete from EDI837I.EDI837I_L1000_Loop; delete from EDI837I.EDIFileInformation; 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_Failures; delete from dbo.OutboundStage; delete from dbo.Outbound_Sequence;