Author |
Topic |
pramod21
Yak Posting Veteran
64 Posts |
Posted - 2011-02-24 : 02:53:26
|
hi all,I have a script which update and insert a data in the database,I want to write a query in such way that, it checks for latest date with the system date and start updating the data after that latest date.if u have any such code then plz help me out? |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-02-24 : 03:05:40
|
That's too brief. You need to explain more in detail what do you want to do ? what do you want to achieve ?Post any table DDL, sample data in DML format and explain any business logic and show us the expected result. KH[spoiler]Time is always against us[/spoiler] |
 |
|
pramod21
Yak Posting Veteran
64 Posts |
Posted - 2011-02-24 : 04:40:28
|
Below code will fetch data from one particular databse.and will insert into our main database on server.i want it should compare sysdate with the latest data that has alreay inserted.so it will insert only those rows that are present after the latest date.for eg:i have latest data till 18 feb.and today is 24 feb.suppose if i m runing this query today.it should insert the data after the 18 feb.SET NOCOUNT ONIF OBJECT_ID('ODBC_RunHistory') IS NULL BEGIN PRINT 'The ODBC_RunHistory table does not exist. Please run the Create OAK tables.sql script.' RETURN ENDIF (SELECT COUNT(*) FROM ODBC_RunHistory) > 0 BEGIN PRINT 'The ODBC_RunHistory table contains information. Please run the Create OAK tables.sql script to clear out the tables.' RETURN ENDDECLARE @RunDate datetime, @Counter int, @CurrentTableName varchar(1000), @SQL nvarchar(4000), @DD datetime-- This variable holds the time and date of when the table was first populatedSET @RunDate = GETDATE()PRINT 'Starting data entry for vw_ODBC_actv_BatchInformation'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_actv_BatchInformation SELECT LicenseKey, BatchInformation_UID, BatchNumber, PostingDate, ServiceDate, DateClosed, Status, BatchOwner, CreatedAt, CreatedBy, ChangedBy, ChangedAt, Display FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_actv_BatchInformation where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_actv_BatchInformation', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_actv_BatchInformation is done!'PRINT 'Starting data entry for vw_ODBC_actv_CarrierBillingHistory'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_actv_CarrierBillingHistory SELECT LicenseKey, CarrierBillingHistory_UID, SeqNumberLastBilled, CarrierBilledDate, ChargeDetailFID, VisitFID, ProxyVisitFID, ClaimIDSuffix, ClaimID, PaperEDI, CarrierFID, CarrierCode, PreviousSequenceNumber, BilledAmount, IsDemand FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_actv_CarrierBillingHistory where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_actv_CarrierBillingHistory', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_actv_CarrierBillingHistory is done!'PRINT 'Starting data entry for vw_ODBC_actv_ChargeDetail'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_actv_ChargeDetail SELECT LicenseKey, ChargeDetail_UID, PostingDate, VisitFID, PatientFID, ResponsiblePartyFID, BeginDateOfService, EndDateOfService, ChargeCodeFID, PlaceOfServiceFID, TypeOfServiceFID, AgingDate, BillInsurance, InsuranceBilled, Fee, Units, DayClosed, Posted, Void, VoidedFID, LastBilledCarrierSequenceNumber, PaidOff, PatientPortion, InsurancePortion, FinancialClassFID, BatchInformationFID, AllowedAmount, CreatedBy, Display, PaymentPlan, InsuranceBalance, PatientBalance, CarrierBillingHistoryFID, AsstProviderFID, ResidentFID, Protected, NoteFID, NetFee, LineItemNote, IncludeOnStatement, Duration, COBCodeFID, CreatedAt, ChangedAt, ChangedBy, DiagnosisCodes, Modifiers, AssessmentDate, AttendingPrvProfileFID, NonCoveredCharges, OperatingPrvProfileFID, OtherProviderProfileFID, FacilityTaxAmount, ServiceTaxAmount, UnitsTypeCode, DOSWasSystemGenerated, TotalDue, TotalPortion, BillStatusFID FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_actv_ChargeDetail where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_actv_ChargeDetail', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_actv_ChargeDetail is done!'PRINT 'Starting data entry for vw_ODBC_actv_ClaimEdits'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_actv_ClaimEdits SELECT LicenseKey, ClaimEdit_UID, VisitFID, ClaimEditFID, RuleCode, ProcedureCode, ErrorMessage, ShortErrorMessage, ClaimEditStatusFID, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_actv_ClaimEdits where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_actv_ClaimEdits', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_actv_ClaimEdits is done!'PRINT 'Starting data entry for vw_ODBC_actv_ClaimRun'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_actv_ClaimRun SELECT ClaimRun_UID, LicenseKey, SubmitterFID, CreatedBy, CreatedAt, ChangedBy, ChangedAt, TotalAmount, SubmittedAt, ReceivedAt, PaidAt, ClaimTemplateFID, DataFileURL, HTMLFileURL, FilePath, TrackingNumber, TestMode, ClaimCount, IsDemand, IsTrial FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_actv_ClaimRun where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_actv_ClaimRun', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_actv_ClaimRun is done!'PRINT 'Starting data entry for vw_ODBC_actv_ClaimSubmission'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_actv_ClaimSubmission SELECT ClaimSubmission_UID, LicenseKey, ClaimRunFID, VisitFID, ProxyVisitFID, ClaimId, TotalAmount, CarrierFID, ThirdPartyStatusFID, ThirdPartyPayorID, ThirdPartyClaimID, CreatedBy, CreatedAt, ChangedBy, ChangedAt, HideExclusion FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_actv_ClaimSubmission where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_actv_ClaimSubmission', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_actv_ClaimSubmission is done!'PRINT 'Starting data entry for vw_ODBC_actv_CustomClaimFieldValueCharge'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_actv_CustomClaimFieldValueCharge SELECT LicenseKey, CustomClaimFieldValueCharge_UID, ChargeDetailFID, ClaimFieldFID, TextValue, FIDValue, CreatedBy, CreatedAt, ChangedBy, ChangedAt, Display FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_actv_CustomClaimFieldValueCharge where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_actv_CustomClaimFieldValueCharge', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_actv_CustomClaimFieldValueCharge is done!'PRINT 'Starting data entry for vw_ODBC_actv_CustomClaimFieldValueVisit'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_actv_CustomClaimFieldValueVisit SELECT LicenseKey, CustomClaimFieldValueVisit_UID, VisitFID, ClaimFieldFID, TextValue, FIDValue, CreatedBy, CreatedAt, ChangedBy, ChangedAt, Display FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_actv_CustomClaimFieldValueVisit where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_actv_CustomClaimFieldValueVisit', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_actv_CustomClaimFieldValueVisit is done!'PRINT 'Starting data entry for vw_ODBC_actv_Episodes'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_actv_Episodes SELECT LicenseKey, Episode_UID, Description, ResponsiblePartyFID, InsuranceBillingSequence, FinancialClassFID, ReferralPlanFID, PatientFID, CreatedAt, CreatedBy, ChangedBy, ChangedAt, Display, ExtraInsuranceInformationFID, GroupByMonth, PlanCreateDate, PTOffsetDays, STOffsetDays, OTOffsetDays FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_actv_Episodes where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_actv_Episodes', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_actv_Episodes is done!'PRINT 'Starting data entry for vw_ODBC_actv_Evaluation'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_actv_Evaluation SELECT LicenseKey, Evaluation_UID, EpisodeFID, EvaluationDate, EvaluationTypeFID, CreatedAt, CreatedBy, ChangedAt, ChangedBy, Display FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_actv_Evaluation where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_actv_Evaluation', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_actv_Evaluation is done!'PRINT 'Starting data entry for vw_ODBC_actv_ExtraInsuranceInformation'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_actv_ExtraInsuranceInformation SELECT LicenseKey, ExtraInsuranceInfo_UID, HospitalEntryDate, HospitalReleaseDate, TotalDisabilityStartDate, TotalDisabilityEndDate, DateSimilarSymptom, DateofInjury, ResultofAccident, EmergencyTreatment, WorkInjury, OutsideLab, PayProvider, ReleaseSignature, EPSDT, FamilyPlanning, SupplierProviderNumber, OutsideLabCharges, AccidentState, Text1, AutoAccident, DateLastSeen, MedicaidResubCode, OriginalRefNum, SupervisingProfileFID, OrderingRefProviderFID, AccidentCrimeVictim, AccidentWithMedCoverage, AccidentWithoutMedCoverage, AccidentWithNoFaultCoverage, ConditionPregnant, LastTherapyDate, SymptomDate, CreatedBy, CreatedAt, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_actv_ExtraInsuranceInformation where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_actv_ExtraInsuranceInformation', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_actv_ExtraInsuranceInformation is done!'PRINT 'Starting data entry for vw_ODBC_actv_HipaaSituationalFieldValues'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_actv_HipaaSituationalFieldValues SELECT LicenseKey, SituationalFieldValue_UID, ExtraInsuranceInfoFID, SituationalFieldFID, Value, Display, CreatedAt, CreatedBy, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_actv_HipaaSituationalFieldValues where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_actv_HipaaSituationalFieldValues', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_actv_HipaaSituationalFieldValues is done!'PRINT 'Starting data entry for vw_ODBC_actv_InstHealthInfo'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_actv_InstHealthInfo SELECT LicenseKey, InstHealthInfo_UID, ChargeCodeFID, DiagnosisCodeFID, HealthInfoCodeFID, VisitFID, Amount, Display, FromDate, ThruDate, TypeCode, CreatedBy, CreatedAt, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_actv_InstHealthInfo where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_actv_InstHealthInfo', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_actv_InstHealthInfo is done!'PRINT 'Starting data entry for vw_ODBC_actv_InstPaperwork'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_actv_InstPaperwork SELECT LicenseKey, InstPaperwork_UID, VisitFID, AvailibilityCode, ControlNumber, Display, ReportTypeCode, CreatedBy, CreatedAt, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_actv_InstPaperwork where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_actv_InstPaperwork', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_actv_InstPaperwork is done!'PRINT 'Starting data entry for vw_ODBC_actv_InstVisit'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_actv_InstVisit SELECT LicenseKey, InstVisit_UID, AdmittingDiagnosisCodeFID, AttendingPrvProfileFID, OperatingPrvProfileFID, OtherProviderProfileFID, PrincipalDiagnosisCodeFID, PrincipalProcedureCodeFID, RelatedGroupDiagnosisCodeFID, VisitFID, AdmissionDate, AdmissionSourceCode, AdmissionTime, AdmissionTypeCode, AdmittingDiagnosisTypeCode, AuthorizationExceptCode, BillClassificationCode, BillingNoteText, CoInsuredDaysQty, CoveredDaysQty, DelayReasonCode, DemonstrationProjectID, DeviceExemptID, DischargeTime, ExplanationOfBenefitsCode, FacilityTypeCode, NonCoveredDaysQty, NoteText, NoteTypeCode, OriginalReferenceID, PatientStatusCode, PrincipalProcedureDate, PrincipalProcedureTypeCode, ReferralID, ReserveDaysQty, StmtFromDate, StmtThruDate, SubmissionReasonCode, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_actv_InstVisit where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_actv_InstVisit', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_actv_InstVisit is done!'PRINT 'Starting data entry for vw_ODBC_actv_lnk_ChargeDetail_DiagnosisCodes'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_actv_lnk_ChargeDetail_DiagnosisCodes SELECT LicenseKey, ChargeDetailDiagnosisCode_UID, ChargeDetailFID, DiagnosisCodeFID, CodeSequence FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_actv_lnk_ChargeDetail_DiagnosisCodes where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_actv_lnk_ChargeDetail_DiagnosisCodes', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_actv_lnk_ChargeDetail_DiagnosisCodes is done!'PRINT 'Starting data entry for vw_ODBC_actv_lnk_ChargeDetail_ModifierCodes'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_actv_lnk_ChargeDetail_ModifierCodes SELECT LicenseKey, ChargeDetailModifierCode_UID, ChargeDetailFID, ModifierCodeFID, CodeSequence FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_actv_lnk_ChargeDetail_ModifierCodes where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_actv_lnk_ChargeDetail_ModifierCodes', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_actv_lnk_ChargeDetail_ModifierCodes is done!'PRINT 'Starting data entry for vw_ODBC_actv_PaymentDetailReason'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_actv_PaymentDetailReason SELECT LicenseKey, PaymentDetailReason_UID, PaymentDetailFID, PaymentReasonFID, Amount, Units, Display, CreatedAt, CreatedBy, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_actv_PaymentDetailReason where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_actv_PaymentDetailReason', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_actv_PaymentDetailReason is done!'PRINT 'Starting data entry for vw_ODBC_actv_PaymentDetails'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_actv_PaymentDetails SELECT LicenseKey, PaymentDetail_UID, PaymentFID, PaymentAmount, PaymentStatus, ChargeDetailFID, Posted, Void, Unapplied, Transferred, ReasonCode, Display, ProfileFID, VoidedFID, TransferredFID, Protected, LastActionHistoryFID, ReversalFID, CreatedBy, CreatedAt, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_actv_PaymentDetails where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_actv_PaymentDetails', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_actv_PaymentDetails is done!'PRINT 'Starting data entry for vw_ODBC_actv_PaymentPlan'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_actv_PaymentPlan SELECT LicenseKey, PaymentPlan_UID, StartDate, Payment, InterestPercent, AnnualMonthly, Duration, CreatedAt, CreatedBy, ResponsiblePartyFID, TotalPaymentPlanAmount, TotalCharges, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_actv_PaymentPlan where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_actv_PaymentPlan', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_actv_PaymentPlan is done!'PRINT 'Starting data entry for vw_ODBC_actv_Payments'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_actv_Payments SELECT LicenseKey, Payment_UID, PatientFID, PaymentSource, PaymentAmount, PaymentMethodFID, CheckNumber, PayingCarrierFID, NoteFID, IncludeonStatement, EntryDate, DepositDate, BatchInformationFID, CreatedBy, Display, PaymentCodeFID, DayClosed, ResponsiblePartyFID, TakebackAmount, TakebackNote, CreatedAt, ChangedAt, ChangedBy, AppliedAt, AppliedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_actv_Payments where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_actv_Payments', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_actv_Payments is done!'PRINT 'Starting data entry for vw_ODBC_actv_ProviderInvoice'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_actv_ProviderInvoice SELECT LicenseKey, ProviderInvoice_UID, InvoiceNumber, CheckNumber, CreatedAt, CreatedBy, ChangedAt, ChangedBy, CheckPostedAt, CheckPostedBy, ProviderFID FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_actv_ProviderInvoice where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_actv_ProviderInvoice', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_actv_ProviderInvoice is done!'PRINT 'Starting data entry for vw_ODBC_actv_ProviderInvoiceDetail'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_actv_ProviderInvoiceDetail SELECT LicenseKey, ProviderInvoiceDetail_UID, ProviderInvoiceFID, ChargeDetailFID, Amount, CreatedAt, CreatedBy, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_actv_ProviderInvoiceDetail where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_actv_ProviderInvoiceDetail', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_actv_ProviderInvoiceDetail is done!'PRINT 'Starting data entry for vw_ODBC_actv_WriteOffDetails'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_actv_WriteOffDetails SELECT LicenseKey, WriteOffDetail_UID, WriteOffFID, WriteOffAmount, ChargeDetailFID, Posted, Void, Unapplied, Transferred, CreatedBy, Display, ProfileFID, VoidedFID, TransferredFID, Protected, CreatedAt, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_actv_WriteOffDetails where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_actv_WriteOffDetails', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_actv_WriteOffDetails is done!'PRINT 'Starting data entry for vw_ODBC_actv_WriteOffs'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_actv_WriteOffs SELECT LicenseKey, WriteOffs_UID, WriteOffCodeFID, Amount, Void, BatchInformationFID, PatientFID, EntryDate, WriteoffSource, DayClosed, NoteFID, IncludeonStatement, Description, CreatedBy, CreatedAt, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_actv_WriteOffs where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_actv_WriteOffs', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_actv_WriteOffs is done!'PRINT 'Starting data entry for vw_ODBC_appts_AppointmentHistory'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_appts_AppointmentHistory SELECT LicenseKey, AppointmentHistory_UID, AppointmentFID, ColumnHeadingFID, StartDateTime, Action, CancelNoShowReasonFID, CreatedAt, CreatedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_appts_AppointmentHistory where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_appts_AppointmentHistory', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_appts_AppointmentHistory is done!'PRINT 'Starting data entry for vw_ODBC_appts_Appointments'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_appts_Appointments SELECT LicenseKey, Appointment_UID, PatientFID, ColumnHeadingFID, StartDateTime, Duration, Color, ProfileFID, WaitList, Comments, ApptStatus, ArriveTime, OtherTime, SeenTime, VisitPosted, ConfirmUser, ConfirmDate, ConfirmMethodFID, ChangedAt, CreatedAt, ChangedBy, CreatedBy, ReferralPlanFID, UpdateReferral, ExtraInsuranceInformationFID, EpisodeFID, FacilityFID, VisitNote, IncludeOnHCFA, InsuranceBillingSequence, AcceptAssignment, ForcePaperClaim, PaymentFID, ApprovedBy, ApprovedAt, ClaimEditStatusFID, ReferenceID, DocumentationComplete, ApptTypes, ApptInstructions, RecurringAppointmentFID FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_appts_Appointments where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_appts_Appointments', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_appts_Appointments is done!'PRINT 'Starting data entry for vw_ODBC_appts_BlockHoldExceptions'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_appts_BlockHoldExceptions SELECT LicenseKey, BlockHoldException_UID, BlockHoldRuleFID, ExceptionDate, ColumnHeadingFID FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_appts_BlockHoldExceptions where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_appts_BlockHoldExceptions', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_appts_BlockHoldExceptions is done!'PRINT 'Starting data entry for vw_ODBC_appts_BlockHoldRules'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_appts_BlockHoldRules SELECT LicenseKey, BlockHoldRule_UID, ReasonFID, ProfileFID, ColumnHeadingFID, StartDateTime, EndDateTime, RuleType, DaysOfWeek, Interval, HoldColor, RuleText, Display, CreatedBy, CreatedAt, Providers, ColumnHeadings, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_appts_BlockHoldRules where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_appts_BlockHoldRules', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_appts_BlockHoldRules is done!'PRINT 'Starting data entry for vw_ODBC_appts_InsuranceOrder'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_appts_InsuranceOrder SELECT LicenseKey, AppointmentFID, PatientFID, PatientInsuranceCoverageFID, Ordinal FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_appts_InsuranceOrder where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_appts_InsuranceOrder', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_appts_InsuranceOrder is done!'PRINT 'Starting data entry for vw_ODBC_appts_lnk_Appointments_ApptInstructions'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_appts_lnk_Appointments_ApptInstructions SELECT LicenseKey, AppointmentApptInstruction_UID, AppointmentFID, ApptInstructionFID FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_appts_lnk_Appointments_ApptInstructions where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_appts_lnk_Appointments_ApptInstructions', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_appts_lnk_Appointments_ApptInstructions is done!'PRINT 'Starting data entry for vw_ODBC_appts_lnk_Appointments_ApptTypes'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_appts_lnk_Appointments_ApptTypes SELECT LicenseKey, AppointmentApptType_UID, AppointmentFID, ApptTypeFID FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_appts_lnk_Appointments_ApptTypes where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_appts_lnk_Appointments_ApptTypes', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_appts_lnk_Appointments_ApptTypes is done!'PRINT 'Starting data entry for vw_ODBC_appts_lnk_ApptTypeSettings_ApptInstructions'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_appts_lnk_ApptTypeSettings_ApptInstructions SELECT LicenseKey, ApptTypeSettingsApptInstruction_UID, ApptTypeSettingsFID, ApptInstructionFID FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_appts_lnk_ApptTypeSettings_ApptInstructions where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_appts_lnk_ApptTypeSettings_ApptInstructions', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_appts_lnk_ApptTypeSettings_ApptInstructions is done!'PRINT 'Starting data entry for vw_ODBC_appts_lnk_BlockHoldRules_ColumnHeadings'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_appts_lnk_BlockHoldRules_ColumnHeadings SELECT LicenseKey, BlockHoldRuleFID, ColumnHeadingFID FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_appts_lnk_BlockHoldRules_ColumnHeadings where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_appts_lnk_BlockHoldRules_ColumnHeadings', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_appts_lnk_BlockHoldRules_ColumnHeadings is done!'PRINT 'Starting data entry for vw_ODBC_appts_lnk_BlockHoldRules_Providers'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_appts_lnk_BlockHoldRules_Providers SELECT LicenseKey, BlockHoldRuleFID, ProfileFID FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_appts_lnk_BlockHoldRules_Providers where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_appts_lnk_BlockHoldRules_Providers', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_appts_lnk_BlockHoldRules_Providers is done!'PRINT 'Starting data entry for vw_ODBC_appts_lnk_Pages_ColumnHeadings'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_appts_lnk_Pages_ColumnHeadings SELECT LicenseKey, PagesColumnHeadings_UID, PageFID, ColumnHeadingFID FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_appts_lnk_Pages_ColumnHeadings where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_appts_lnk_Pages_ColumnHeadings', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_appts_lnk_Pages_ColumnHeadings is done!'PRINT 'Starting data entry for vw_ODBC_appts_lnk_WaitList_ColumnHeadings'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_appts_lnk_WaitList_ColumnHeadings SELECT LicenseKey, WaitListFID, ColumnHeadingFID FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_appts_lnk_WaitList_ColumnHeadings where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_appts_lnk_WaitList_ColumnHeadings', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_appts_lnk_WaitList_ColumnHeadings is done!'PRINT 'Starting data entry for vw_ODBC_appts_lnk_WaitList_Providers'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_appts_lnk_WaitList_Providers SELECT LicenseKey, WaitListFID, ProfileFID FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_appts_lnk_WaitList_Providers where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_appts_lnk_WaitList_Providers', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_appts_lnk_WaitList_Providers is done!'PRINT 'Starting data entry for vw_ODBC_appts_mf_ApptInstructions'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_appts_mf_ApptInstructions SELECT LicenseKey, ApptInstruction_UID, Name, Instruction, CreatedAt, CreatedBy, Display, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_appts_mf_ApptInstructions where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_appts_mf_ApptInstructions', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_appts_mf_ApptInstructions is done!'PRINT 'Starting data entry for vw_ODBC_appts_mf_ApptTypes'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_appts_mf_ApptTypes SELECT LicenseKey, ApptType_UID, Name, IsDefault, IsBillable, CreatedAt, CreatedBy, Display, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_appts_mf_ApptTypes where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_appts_mf_ApptTypes', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_appts_mf_ApptTypes is done!'PRINT 'Starting data entry for vw_ODBC_appts_mf_ApptTypeSettingDocuments'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_appts_mf_ApptTypeSettingDocuments SELECT ApptTypeSettingDocument_UID, LicenseKey, ApptTypeSettingsFID, DocumentTemplateFID FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_appts_mf_ApptTypeSettingDocuments where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_appts_mf_ApptTypeSettingDocuments', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_appts_mf_ApptTypeSettingDocuments is done!'PRINT 'Starting data entry for vw_ODBC_appts_mf_ApptTypeSettings'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_appts_mf_ApptTypeSettings SELECT LicenseKey, ApptTypeSettings_UID, ApptTypeFID, Duration, Color, Hide, ChargeSlipTemplateFID, ProfileFID, CreatedBy, CreatedAt, ChangedBy, ChangedAt, Documents, Instructions, WaitListPriorityFID FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_appts_mf_ApptTypeSettings where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_appts_mf_ApptTypeSettings', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_appts_mf_ApptTypeSettings is done!'PRINT 'Starting data entry for vw_ODBC_appts_mf_ColumnHeadings'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_appts_mf_ColumnHeadings SELECT LicenseKey, ColumnHeading_UID, ColumnHeading, ProfileFID, UsePatientProvider, DayStartTime, DayEndTime, TimeIncrement, WorkWeek, AutoHoldDays, UseAutoHoldDefault, FacilityFID, Display, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_appts_mf_ColumnHeadings where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_appts_mf_ColumnHeadings', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_appts_mf_ColumnHeadings is done!'PRINT 'Starting data entry for vw_ODBC_appts_mf_ConfirmMethods'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_appts_mf_ConfirmMethods SELECT LicenseKey, ConfirmMethod_UID, Name, ConfirmMethod, CreatedAt, CreatedBy, Display, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_appts_mf_ConfirmMethods where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_appts_mf_ConfirmMethods', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_appts_mf_ConfirmMethods is done!'PRINT 'Starting data entry for vw_ODBC_appts_mf_Pages'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_appts_mf_Pages SELECT LicenseKey, Page_UID, PageName, PageGroup, Ordinal, UserFID, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_appts_mf_Pages where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_appts_mf_Pages', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_appts_mf_Pages is done!'PRINT 'Starting data entry for vw_ODBC_appts_mf_ProviderScheduleSetup'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_appts_mf_ProviderScheduleSetup SELECT ProviderScheduleSetup_UID, LicenseKey, ProfileFID, DayStartTime, DayEndTime, TimeIncrement, WorkWeek, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_appts_mf_ProviderScheduleSetup where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_appts_mf_ProviderScheduleSetup', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_appts_mf_ProviderScheduleSetup is done!'PRINT 'Starting data entry for vw_ODBC_appts_mf_Reasons'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_appts_mf_Reasons SELECT LicenseKey, Reason_UID, Type, Reason, CreatedAt, CreatedBy, Display, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_appts_mf_Reasons where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_appts_mf_Reasons', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_appts_mf_Reasons is done!'PRINT 'Starting data entry for vw_ODBC_appts_WaitList'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_appts_WaitList SELECT WaitList_UID, LicenseKey, AppointmentFID, Comments, RemoveComments, Display, CreatedBy, CreatedAt, ChangedBy, ChangedAt, ProfileList, ColumnList FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_appts_WaitList where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_appts_WaitList', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_appts_WaitList is done!'PRINT 'Starting data entry for vw_ODBC_bill_Billing'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_bill_Billing SELECT LicenseKey, Billing_UID, BillingRunFID, CollectionLetterFID, IsWrittenOff, HoldFID, MoveFID, BillingDate, StatementGroupFID, ProfileFID, ResponsiblePartyFID, PatientFID, OrderField, SumFee, InsurancePortion, PatientPortion, InsuranceBalance, PatientBalance, Ins_Current, Pt_Current, Ins_30_Days, Pt_30_Days, Ins_60_Days, Pt_60_Days, Ins_90_Days, Pt_90_Days, Ins_120_Days, Pt_120_Days, InsUnapplied, PtUnapplied, PaymentDue, AgencyEligibleDate, StatementCount, CollectionLetterCount, CollectionAgencyCount, CreatedAt, CreatedBy, ChangedAt, ChangedBy, DunningMessage, BillingMessage, OldestChargeAgingDate FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_bill_Billing where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_bill_Billing', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_bill_Billing is done!'PRINT 'Starting data entry for vw_ODBC_bill_BillingDetail'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_bill_BillingDetail SELECT LicenseKey, BillingDetail_UID, BillingFID, ChargeDetailFID, VisitFID, WriteOffCodeFID, WriteOffFID, EpisodeFID, ProfileFID, ResponsiblePartyFID, PatientFID, ChargeCodeFID, Fee, Receipts, PatientReceipts, Adjustments, Balance, PatientPortion, PatientBalance, InsurancePortion, InsuranceBalance, DOS, IsStatementCharge, IsBalanceForward, CreatedAt, CreatedBy, ChangedAt, ChangedBy, DetailDescription, PaymentPlanMessage, LineItemNote FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_bill_BillingDetail where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_bill_BillingDetail', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_bill_BillingDetail is done!'PRINT 'Starting data entry for vw_ODBC_bill_BillingFormat'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_bill_BillingFormat SELECT LicenseKey, BillingFormat_UID, BillingFormatName, IsElectronic, ByRespParty, ByPatient, IsCollections, IsAgency, ReportingServicesID FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_bill_BillingFormat where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_bill_BillingFormat', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_bill_BillingFormat is done!'PRINT 'Starting data entry for vw_ODBC_bill_BillingLineItem'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_bill_BillingLineItem SELECT LicenseKey, BillingLineItem_UID, BillingDetailFID, PaymentFID, WriteOffFID, LineItemType, Amount, EntryDate, Note, LineTypeFID, CreatedAt, CreatedBy, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_bill_BillingLineItem where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_bill_BillingLineItem', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_bill_BillingLineItem is done!'PRINT 'Starting data entry for vw_ODBC_bill_BillingRun'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_bill_BillingRun SELECT LicenseKey, BillingRun_UID, RequestFID, BillingStatusFID, BillingFormatFID, IsDemand, IsPaymentPlan, ByResponsibleParty, CreatedAt, CreatedBy, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_bill_BillingRun where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_bill_BillingRun', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_bill_BillingRun is done!'PRINT 'Starting data entry for vw_ODBC_bill_BillingStatus'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_bill_BillingStatus SELECT LicenseKey, BillingStatus_UID, BillingStatusDescription FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_bill_BillingStatus where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_bill_BillingStatus', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_bill_BillingStatus is done!'PRINT 'Starting data entry for vw_ODBC_bill_Hold'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_bill_Hold SELECT LicenseKey, Hold_UID, HoldTypeFID, HoldUntilDate, HoldReasonFID, CreatedAt, CreatedBy, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_bill_Hold where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_bill_Hold', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_bill_Hold is done!'PRINT 'Starting data entry for vw_ODBC_bill_HoldType'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_bill_HoldType SELECT LicenseKey, HoldType_UID, HoldTypeDescription FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_bill_HoldType where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_bill_HoldType', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_bill_HoldType is done!'PRINT 'Starting data entry for vw_ODBC_bill_LineType'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_bill_LineType SELECT LicenseKey, LineType_UID, LineTypeDescription FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_bill_LineType where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_bill_LineType', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_bill_LineType is done!'PRINT 'Starting data entry for vw_ODBC_bill_Move'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_bill_Move SELECT LicenseKey, Move_UID, ResponsiblePartyFID, FromBillingFormatFID, ToBillingFormatFID, ExpireDate, HoldReasonFID, CreatedAt, CreatedBy, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_bill_Move where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_bill_Move', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_bill_Move is done!'PRINT 'Starting data entry for vw_ODBC_bill_PaymentPlanDetail'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_bill_PaymentPlanDetail SELECT LicenseKey, PaymentPlanDetail_UID, BillingFID, ChargeDetailFID, PatientBalance, CreatedAt, CreatedBy, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_bill_PaymentPlanDetail where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_bill_PaymentPlanDetail', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_bill_PaymentPlanDetail is done!'PRINT 'Starting data entry for vw_ODBC_bill_RequestQueue'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_bill_RequestQueue SELECT LicenseKey, Request_UID, BillingStatusFID, CreatedAt, CreatedBy, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_bill_RequestQueue where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_bill_RequestQueue', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_bill_RequestQueue is done!'PRINT 'Starting data entry for vw_ODBC_col_Account'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_col_Account SELECT LicenseKey, Account_UID, WorklistLicenseKey, WorkListFID, ResponsiblePartyFID, InsuranceBalance, PatientBalance, PastDuePatientBalance, PastDueInsuranceBalance, DaysPastDue FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_col_Account where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_col_Account', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_col_Account is done!'PRINT 'Starting data entry for vw_ODBC_col_Action'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_col_Action SELECT Action_UID, LicenseKey, Action, Type, NextActionFID, FollowUpDays, DefaultSentLetter, Display, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_col_Action where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_col_Action', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_col_Action is done!'PRINT 'Starting data entry for vw_ODBC_col_ActionHistory'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_col_ActionHistory SELECT LicenseKey, ActionHistory_UID, ResponsiblePartyFID, ActionFID, NextActionFID, ActionDate, NextActionDate, CollectorFID, Balance, PromisedPayment, PromisedDate, Note, Display, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_col_ActionHistory where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_col_ActionHistory', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_col_ActionHistory is done!'PRINT 'Starting data entry for vw_ODBC_col_DenialActionHistory'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_col_DenialActionHistory SELECT LicenseKey, ActionHistory_UID, PaymentDetailFID, ActionFID, NextActionFID, ActionDate, NextActionDate, Username, Note, Display, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_col_DenialActionHistory where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_col_DenialActionHistory', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_col_DenialActionHistory is done!'PRINT 'Starting data entry for vw_ODBC_col_WorkList'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_col_WorkList SELECT LicenseKey, WorkList_UID, CollectorFID, PriorityOrder, WorkListName, FamilyInsuranceBoth, DaysPastDue, RPLastNameFrom, RPLastNameTo, Display, CreatedBy, CreatedAt, ChangedBy, ChangedAt, Carriers, AccountTypes, Actions, CarrierCategories, FinancialClasses, Profiles, Groups FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_col_WorkList where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_col_WorkList', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_col_WorkList is done!'PRINT 'Starting data entry for vw_ODBC_col_Worklist_AccountType'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_col_Worklist_AccountType SELECT LicenseKey, WorklistAccountType_UID, WorklistFID, AccountTypeFID, AccountTypeCode FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_col_Worklist_AccountType where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_col_Worklist_AccountType', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_col_Worklist_AccountType is done!'PRINT 'Starting data entry for vw_ODBC_col_Worklist_Action'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_col_Worklist_Action SELECT LicenseKey, WorklistAction_UID, WorklistFID, ActionFID, ActionCode FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_col_Worklist_Action where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_col_Worklist_Action', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_col_Worklist_Action is done!'PRINT 'Starting data entry for vw_ODBC_col_WorkList_Carrier'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_col_WorkList_Carrier SELECT LicenseKey, WorklistCarrier_UID, WorkListFID, CarrierFID, CarrierCode FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_col_WorkList_Carrier where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_col_WorkList_Carrier', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_col_WorkList_Carrier is done!'PRINT 'Starting data entry for vw_ODBC_col_Worklist_CarrierCategory'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_col_Worklist_CarrierCategory SELECT LicenseKey, WorklistCarrierCategory_UID, WorklistFID, CarrierCategoryFID, CarrierCategoryCode FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_col_Worklist_CarrierCategory where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_col_Worklist_CarrierCategory', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_col_Worklist_CarrierCategory is done!'PRINT 'Starting data entry for vw_ODBC_col_Worklist_FinancialClass'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_col_Worklist_FinancialClass SELECT LicenseKey, WorklistFinancialClass_UID, WorklistFID, FinancialClassFID, FinancialClassCode FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_col_Worklist_FinancialClass where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_col_Worklist_FinancialClass', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_col_Worklist_FinancialClass is done!'PRINT 'Starting data entry for vw_ODBC_col_Worklist_Group'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_col_Worklist_Group SELECT LicenseKey, WorklistGroup_UID, WorklistFID, GroupFID, GroupCode FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_col_Worklist_Group where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_col_Worklist_Group', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_col_Worklist_Group is done!'PRINT 'Starting data entry for vw_ODBC_col_Worklist_Profile'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_col_Worklist_Profile SELECT LicenseKey, WorklistProfile_UID, WorklistFID, ProfileFID, ProfileCode FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_col_Worklist_Profile where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_col_Worklist_Profile', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_col_Worklist_Profile is done!'PRINT 'Starting data entry for vw_ODBC_ct_ClaimRun'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_ct_ClaimRun SELECT ClaimRun_UID, LicenseKey, ClaimRunFID, EventFID, EventDate, IsProblem, Note FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_ct_ClaimRun where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_ct_ClaimRun', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_ct_ClaimRun is done!'PRINT 'Starting data entry for vw_ODBC_ct_ClaimSubmission'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_ct_ClaimSubmission SELECT ClaimSubmission_UID, LicenseKey, ClaimSubmissionFID, EventFID, EventDate, IsProblem, Note FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_ct_ClaimSubmission where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_ct_ClaimSubmission', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_ct_ClaimSubmission is done!'PRINT 'Starting data entry for vw_ODBC_ct_ClaimSubmissionFileMatch'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_ct_ClaimSubmissionFileMatch SELECT LicenseKey, ClaimSubmissionFID, FilePath, FileDate FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_ct_ClaimSubmissionFileMatch where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_ct_ClaimSubmissionFileMatch', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_ct_ClaimSubmissionFileMatch is done!'PRINT 'Starting data entry for vw_ODBC_ct_ClaimThirdPartyStatus'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_ct_ClaimThirdPartyStatus SELECT LicenseKey, ThirdPartyStatus_UID, StatusDescription FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_ct_ClaimThirdPartyStatus where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_ct_ClaimThirdPartyStatus', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_ct_ClaimThirdPartyStatus is done!'PRINT 'Starting data entry for vw_ODBC_ct_Event'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_ct_Event SELECT LicenseKey, Event_UID, EventDescription, DisplayInApplication FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_ct_Event where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_ct_Event', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_ct_Event is done!'PRINT 'Starting data entry for vw_ODBC_edi_Era_ClaimStatusCodes'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_edi_Era_ClaimStatusCodes SELECT LicenseKey, ClaimCode, ClaimDescription FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_edi_Era_ClaimStatusCodes where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_edi_Era_ClaimStatusCodes', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_edi_Era_ClaimStatusCodes is done!'PRINT 'Starting data entry for vw_ODBC_edi_Era_PaymentCodes'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_edi_Era_PaymentCodes SELECT LicenseKey, PaymentCode, PaymentDescription FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_edi_Era_PaymentCodes where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_edi_Era_PaymentCodes', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_edi_Era_PaymentCodes is done!'PRINT 'Starting data entry for vw_ODBC_edi_Era_Report'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_edi_Era_Report SELECT Report_UID, LicenseKey, DateReceived, ReportXML, PaymentNumber, PaymentCode, Display FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_edi_Era_Report where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_edi_Era_Report', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_edi_Era_Report is done!'PRINT 'Starting data entry for vw_ODBC_edi_Era_ReportClaim'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_edi_Era_ReportClaim SELECT ERAClaim_UID, LicenseKey, ReportFID, CarrierID, CarrierName, CarrierClaimID, PatientID, ClaimStatus, ClaimID, VisitID, PostFailed, Display, ClaimPaymentAmount, CarrierFID, PatientFullName FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_edi_Era_ReportClaim where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_edi_Era_ReportClaim', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_edi_Era_ReportClaim is done!'PRINT 'Starting data entry for vw_ODBC_edi_Era_ReportClaimAdjudication'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_edi_Era_ReportClaimAdjudication SELECT ERAAdjudication_UID, LicenseKey, ReportFID, ERAClaimFID, RemarkCode, InPatient, Display FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_edi_Era_ReportClaimAdjudication where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_edi_Era_ReportClaimAdjudication', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_edi_Era_ReportClaimAdjudication is done!'PRINT 'Starting data entry for vw_ODBC_edi_Era_ReportDetail'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_edi_Era_ReportDetail SELECT ERAReportDetail_UID, LicenseKey, ReportFID, ERAClaimFID, ChargeCode, AmountCode, AmountPaid, AmountAdjusted, AmountClaim, AmountPatient, AmountAllowed, AmountTakeback, ServiceDate, ChargeDetailID, Display FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_edi_Era_ReportDetail where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_edi_Era_ReportDetail', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_edi_Era_ReportDetail is done!'PRINT 'Starting data entry for vw_ODBC_edi_Era_ReportDetailReason'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_edi_Era_ReportDetailReason SELECT LicenseKey, ReportDetailReason_UID, ERAReportDetailFID, PaymentReasonFID, Amount, Units FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_edi_Era_ReportDetailReason where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_edi_Era_ReportDetailReason', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_edi_Era_ReportDetailReason is done!'PRINT 'Starting data entry for vw_ODBC_edi_Formats'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_edi_Formats SELECT LicenseKey, Format_UID, FormatCode, Description, ClassName, Type, Display FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_edi_Formats where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_edi_Formats', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_edi_Formats is done!'PRINT 'Starting data entry for vw_ODBC_edi_Submitters'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_edi_Submitters SELECT LicenseKey, Submitter_UID, SubmitterCode, SubmitterName, SubmitterID, BillingID, EIN, TPN, Test, BillingName, BillingAptSte, BillingAddress, BillingCity, BillingState, BillingZip, BillingContact, BillingPhone, BillAsGroup, BillingSeq, FormatFID, PartnerFID, Field1, Field3, PayToName, PayToAdd, URL, CreatedAt, CreatedBy, Display, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_edi_Submitters where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_edi_Submitters', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_edi_Submitters is done!'PRINT 'Starting data entry for vw_ODBC_ent_LicenseKeys'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_ent_LicenseKeys SELECT LicenseKey, LicenseName FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_ent_LicenseKeys where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_ent_LicenseKeys', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_ent_LicenseKeys is done!'PRINT 'Starting data entry for vw_ODBC_ent_lnk_CboUsersLicenseKeys'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_ent_lnk_CboUsersLicenseKeys SELECT UserFID, LicenseKey, CreatedBy, CreatedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_ent_lnk_CboUsersLicenseKeys where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_ent_lnk_CboUsersLicenseKeys', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_ent_lnk_CboUsersLicenseKeys is done!'PRINT 'Starting data entry for vw_ODBC_ent_lnk_RolesPrivilege'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_ent_lnk_RolesPrivilege SELECT RolesPrivilege_UID, RoleFID, PrivilegeName, LicenseKey, PrivCreate, PrivRead, PrivUpdate, PrivDelete, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_ent_lnk_RolesPrivilege where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_ent_lnk_RolesPrivilege', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_ent_lnk_RolesPrivilege is done!'PRINT 'Starting data entry for vw_ODBC_ent_lnk_User_EMRProvider'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_ent_lnk_User_EMRProvider SELECT UserEMRProvider_UID, LicenseKey, UserFID, ProviderFID, IsActive FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_ent_lnk_User_EMRProvider where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_ent_lnk_User_EMRProvider', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_ent_lnk_User_EMRProvider is done!'PRINT 'Starting data entry for vw_ODBC_ent_Privilege'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_ent_Privilege SELECT LicenseKey, PrivilegeName, CategoryFID, Description, PrivCreate, PrivRead, PrivUpdate, PrivDelete FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_ent_Privilege where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_ent_Privilege', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_ent_Privilege is done!'PRINT 'Starting data entry for vw_ODBC_ent_PrivilegeCategory'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_ent_PrivilegeCategory SELECT LicenseKey, Category_UID, CategoryName, Description FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_ent_PrivilegeCategory where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_ent_PrivilegeCategory', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_ent_PrivilegeCategory is done!'PRINT 'Starting data entry for vw_ODBC_ent_Role'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_ent_Role SELECT LicenseKey, Role_UID, RoleName, Description, ToolbarCode, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_ent_Role where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_ent_Role', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_ent_Role is done!'PRINT 'Starting data entry for vw_ODBC_ent_User'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_ent_User SELECT User_UID, LicenseKey, RoleFID, FullName, Login, PasswordMD5, PasswordSHA1, PasswordChangedAt, MustChangePassword, Admin, Display, ExpirationDate, EMRProviders, EMRColumns, PromptForProblems, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_ent_User where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_ent_User', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_ent_User is done!'PRINT 'Starting data entry for vw_ODBC_ent_UserStatuses'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_ent_UserStatuses SELECT LicenseKey, Status, StatusDescription FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_ent_UserStatuses where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_ent_UserStatuses', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_ent_UserStatuses is done!'PRINT 'Starting data entry for vw_ODBC_fcm_File'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_fcm_File SELECT File_UID, LicenseKey, Name, Description, FileName, FileLocation, FileType, FileExt, FileSize, PatientFID, ProfileFID, VisitFID, FacilityFID, ReferringProviderFID, DOS, CreatedAt, CreatedBy, ChangedAt, ChangedBy, PrintedAt, PrintedBy, ReviewedAt, ReviewedBy, ApprovedAt, ApprovedBy, LockedAt, LockedBy, Revision, ZipMode, Encoded, ServerFile, Display, CatCodeList FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_fcm_File where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_fcm_File', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_fcm_File is done!'PRINT 'Starting data entry for vw_ODBC_fcm_FileDocHistory'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_fcm_FileDocHistory SELECT FileDocHistory_UID, LicenseKey, FileFID, Revision, Name, Description, FileName, FileLocation, FileSize, Comments, CreatedAt, CreatedBy, ChangedAt, ChangedBy, PrintedAt, PrintedBy, ReviewedAt, ReviewedBy, ApprovedAt, ApprovedBy, LockedAt, LockedBy, CountChars, CountCharsWSpaces, CountWords, CountLines, CountParas, CountPages FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_fcm_FileDocHistory where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_fcm_FileDocHistory', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_fcm_FileDocHistory is done!'PRINT 'Starting data entry for vw_ODBC_fcm_FileDocInfo'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_fcm_FileDocInfo SELECT FileDocInfo_UID, LicenseKey, FileFID, ResourceFID, CountChars, CountCharsWSpaces, CountWords, CountLines, CountParas, CountPages, TemplateDescription FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_fcm_FileDocInfo where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_fcm_FileDocInfo', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_fcm_FileDocInfo is done!'PRINT 'Starting data entry for vw_ODBC_fcm_FileDocInfoLog'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_fcm_FileDocInfoLog SELECT FileDocInfoLog_UID, LicenseKey, FileDocInfoFID, Action, Notes, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_fcm_FileDocInfoLog where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_fcm_FileDocInfoLog', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_fcm_FileDocInfoLog is done!'PRINT 'Starting data entry for vw_ODBC_fcm_FileLog'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_fcm_FileLog SELECT FileLog_UID, LicenseKey, FileFID, Action, Notes, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_fcm_FileLog where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_fcm_FileLog', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_fcm_FileLog is done!'PRINT 'Starting data entry for vw_ODBC_fcm_lnk_FileFileCategory'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_fcm_lnk_FileFileCategory SELECT FileFileCategory_UID, LicenseKey, FileFID, FileCategoryFID FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_fcm_lnk_FileFileCategory where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_fcm_lnk_FileFileCategory', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_fcm_lnk_FileFileCategory is done!'PRINT 'Starting data entry for vw_ODBC_fcm_lnk_FileResource'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_fcm_lnk_FileResource SELECT FileResource_UID, LicenseKey, ResourceFID, FileFID, DownloadStatus FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_fcm_lnk_FileResource where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_fcm_lnk_FileResource', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_fcm_lnk_FileResource is done!'PRINT 'Starting data entry for vw_ODBC_main_AccountsReceivable'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_main_AccountsReceivable SELECT LicenseKey, AccountReceivable_UID, LastYearEOY, AR_Current, AR_30_Days, AR_60_Days, AR_90_Days, AR_MoreThan120Days, UnappliedMoney, TotalBalance FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_main_AccountsReceivable where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_main_AccountsReceivable', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_main_AccountsReceivable is done!'PRINT 'Starting data entry for vw_ODBC_main_FinancialSummaries'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_main_FinancialSummaries SELECT LicenseKey, FinancialSummary_UID, MTD_Charges, MTD_Payments, MTD_WriteOffs, MTD_Units, YTD_Charges, YTD_Payments, YTD_WriteOffs, YTD_Units, TotalBalance, TotalUnppliedMoney FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_main_FinancialSummaries where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_main_FinancialSummaries', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_main_FinancialSummaries is done!'PRINT 'Starting data entry for vw_ODBC_main_Notes'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_main_Notes SELECT LicenseKey, Note_UID, Note, CreatedAt, CreatedBy, Display, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_main_Notes where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_main_Notes', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_main_Notes is done!'PRINT 'Starting data entry for vw_ODBC_main_SystemDefault'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_main_SystemDefault SELECT LicenseKey, SystemDefault_UID, CategoryFID, SequenceNumber, DefaultName, Description, ElementType, Datatype, ExtraInfo, SystemDefault, ReadOnly, DefaultValue, DefaultValueDescription, CBOOnly FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_main_SystemDefault where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_main_SystemDefault', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_main_SystemDefault is done!'PRINT 'Starting data entry for vw_ODBC_main_SystemDefaultCategory'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_main_SystemDefaultCategory SELECT LicenseKey, Category_UID, CategoryName, ParentCategoryFID, SequenceNumber, FeatureAccessRequired FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_main_SystemDefaultCategory where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_main_SystemDefaultCategory', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_main_SystemDefaultCategory is done!'PRINT 'Starting data entry for vw_ODBC_main_SystemDefaultLicenseKey'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_main_SystemDefaultLicenseKey SELECT LicenseKey, SystemDefaultFID, Value, ValueDescription, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_main_SystemDefaultLicenseKey where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_main_SystemDefaultLicenseKey', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_main_SystemDefaultLicenseKey is done!'PRINT 'Starting data entry for vw_ODBC_main_UserFiles'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_main_UserFiles SELECT LicenseKey, UserFile_UID, UserField1, UserField2, UserField3, UserField4, UserField5, UserField6, UserField7, UserField8, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_main_UserFiles where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_main_UserFiles', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_main_UserFiles is done!'PRINT 'Starting data entry for vw_ODBC_mf_AccountTypes'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_AccountTypes SELECT LicenseKey, AccountType_UID, AccountTypeCode, Description, SmallBalanceWriteOffs, AmtsLessThan, WriteOffCodeFID, MinimumStatementBalance, CalculateFinanceCharge, SendStatement, STMTFormatName, STMTFormatFormFID, BillingCycle, FinChgPercentage, FinChgMinimumBalance, FinChgMinimumCharge, FinChgStartTime, CalculateStatementCharges, StatementChargeAmount, ChargeCodeFID, StmtTypeBFOI, DunningMessageFID, DunningMessage30FID, DunningMessage60FID, DunningMessage90FID, DunningMessage120FID, CreatedBy, CreatedAt, Display, ChangedBy, ChangedAt, OneStatementRequired, StatementsBeforeCollections, CollectionRuleFID, CollectionFormatFID, StatementFormatFID FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_AccountTypes where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_AccountTypes', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_AccountTypes is done!'PRINT 'Starting data entry for vw_ODBC_mf_CarrierCategories'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_CarrierCategories SELECT LicenseKey, CarrierCategory_UID, CarrierCategoryCode, CarrierCategoryDescription, Display, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_CarrierCategories where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_CarrierCategories', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_CarrierCategories is done!'PRINT 'Starting data entry for vw_ODBC_mf_Carriers'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_Carriers SELECT LicenseKey, Carrier_UID, CarrierCode, CarrierName, CreatedBy, CreatedAt, AptSte, Address, ZipCode, City, State, AreaCode, CountryCode, ContactName, PaperFormFID, StandardCopayDollarAmt, StandardCoPayPercent, NoteFID, DME, EDICPIDNumber, ElecFormFID, MedigapNumber, TypeofInsurance, SourceofPayment, StateCoverageCode, ElecClaimsBillPrimaryOnly, PayorID, PayorSubID, EligibilityPhoneNumber, EligibilityPhoneExtension, PreAuthPhoneNumber, PreAuthPhoneExtension, FaxNumber, ProviderRelationsPhoneNumber, ProviderRelationsPhoneExtension, EmailAddress, CarrierCategoryFID, FinancialSummaryFID, AccountReceivableFID, Display, Checkbox, RequireReferral, MTDClaims, YTDClaims, BillZeroDollarClaims, POSAliasChangedAt, TOSAliasChangedAt, ChangedBy, ChangedAt, ApprovedAt, ApprovedBy, ProviderIDRequired, EDIAgreementRequired, EDIAgreementApproved, WasImported, ImportCode, UseMasterCarrierList, MergedToCarrierFID, SecondaryPaperFormFID, GrpProvIDPrefix, GrpIDSuffix, ProvIDSuffix, IncludeSupervisingProvider, IncludeOrderingProvider, UseProviderNPIFID, SuppressRenderingInfo, InstContactName, InstAddress1, InstAddress2, InstZipCode, InstCity, InstState, InstAreaCode, InstEligibilityPhoneNumber, InstEligibilityPhoneExtension, InstPreAuthPhoneNumber, InstPreAuthPhoneExtension, InstProviderRelationsPhoneNumber, InstProviderRelationsPhoneExtension, InstFaxNumber, InstEmailAddress, InstProviderIDRequired, InstEDIAgreementRequired, InstEDIAgreementApproved, InstGrpProvIDPrefix, InstPaperFormFID, InstElecFormFID, InstEDICPIDNumber, InstPayorID, InstPayorSubID, InstBillZeroDollarClaims, PrimaryClaimTypeFID, SecondaryClaimTypeFID, Notes, NotesChangedAt, InstNotes, InstNotesChangedAt, WebAddress, InstWebAddress, OtherContact, InstOtherContact, InstUseProviderNPIFID, RenderingQualFID, RenderingSourceFID, BillingQualFID, BillingSourceFID, ReferringQualFID, ReferringSourceFID, BillAsFID, EnableMonthlyBilling FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_Carriers where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_Carriers', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_Carriers is done!'PRINT 'Starting data entry for vw_ODBC_mf_ChargeSlipTemplates'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_ChargeSlipTemplates SELECT LicenseKey, ChargeSlipTemplate_UID, ChargeSlipTemplateCode, ChargeSlipTemplateDescription, Display, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_ChargeSlipTemplates where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_ChargeSlipTemplates', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_ChargeSlipTemplates is done!'PRINT 'Starting data entry for vw_ODBC_mf_ChargeSlipTemplates_Rows'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_ChargeSlipTemplates_Rows SELECT LicenseKey, ChargeSlipTemplateFID, ItemCode1, ItemDescription1, ItemCode2, ItemDescription2, ItemCode3, ItemDescription3, ItemCode4, ItemDescription4, ItemType, RowNum, HeaderOnly, NumberOfColumns, TemplateDiagRowCount, TemplateProcRowCount, DisplayRowType FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_ChargeSlipTemplates_Rows where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_ChargeSlipTemplates_Rows', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_ChargeSlipTemplates_Rows is done!'PRINT 'Starting data entry for vw_ODBC_mf_ChargeslipTemplates_s_Diagnosis'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_ChargeslipTemplates_s_Diagnosis SELECT LicenseKey, ChargeslipDiag_UID, DiagnosisCodeFID, CreatedBy, CreatedAt, ChargeSlipTemplateFID, DiagnosisDescription, DiagnosisSequence, Display, Collapsed, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_ChargeslipTemplates_s_Diagnosis where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_ChargeslipTemplates_s_Diagnosis', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_ChargeslipTemplates_s_Diagnosis is done!'PRINT 'Starting data entry for vw_ODBC_mf_ChargeslipTemplates_s_Procedures'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_ChargeslipTemplates_s_Procedures SELECT LicenseKey, ChargeslipTemplateProcedures_UID, ChargeCodeFID, CreatedBy, CreatedAt, Display, ChargeSlipTemplateFID, ProcedureDescription, ProcedureSequence, Collapsed, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_ChargeslipTemplates_s_Procedures where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_ChargeslipTemplates_s_Procedures', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_ChargeslipTemplates_s_Procedures is done!'PRINT 'Starting data entry for vw_ODBC_mf_ClaimEditExceptions'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_ClaimEditExceptions SELECT LicenseKey, ClaimEditException_UID, ClaimEditFID, CarrierFID, IgnoreEdit, ShortErrorMessage, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_ClaimEditExceptions where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_ClaimEditExceptions', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_ClaimEditExceptions is done!'PRINT 'Starting data entry for vw_ODBC_mf_ClaimEdits'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_ClaimEdits SELECT LicenseKey, ClaimEdit_UID, EditNumber, ErrorMessage, ShortErrorMessage, ClaimEditChecksum, Display FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_ClaimEdits where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_ClaimEdits', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_ClaimEdits is done!'PRINT 'Starting data entry for vw_ODBC_mf_ClaimEditStatuses'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_ClaimEditStatuses SELECT LicenseKey, ClaimEditStatus_UID, Status, Ordinal FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_ClaimEditStatuses where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_ClaimEditStatuses', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_ClaimEditStatuses is done!'PRINT 'Starting data entry for vw_ODBC_mf_COBCodes'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_COBCodes SELECT LicenseKey, COBCode_UID, COBCode, Description, Display, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_COBCodes where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_COBCodes', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_COBCodes is done!'PRINT 'Starting data entry for vw_ODBC_mf_CollectionRule'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_CollectionRule SELECT LicenseKey, CollectionRule_UID, RuleName, Display, CreatedAt, CreatedBy, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_CollectionRule where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_CollectionRule', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_CollectionRule is done!'PRINT 'Starting data entry for vw_ODBC_mf_CollectionRuleStep'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_CollectionRuleStep SELECT LicenseKey, CollectionRuleStep_UID, CollectionRuleFID, Ordinal, CollectionTemplateFID, IsCollectionAgency, DaysNoPayment, WriteOffBalance, WriteOffCodeFID, Display, WriteoffEntireAccount, CreatedAt, CreatedBy, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_CollectionRuleStep where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_CollectionRuleStep', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_CollectionRuleStep is done!'PRINT 'Starting data entry for vw_ODBC_mf_CPTImportDefaults'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_CPTImportDefaults SELECT LicenseKey, CPTImportDefault_UID, DefaultName, LowCode, HighCode, POSValue, TOSValue, ChargeCodeCategoryFID, Tax, Ancillary, Electronic, ReqCLIA, BillInsurance, BillPatient, AssessCopay, Overwrite, Display, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_CPTImportDefaults where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_CPTImportDefaults', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_CPTImportDefaults is done!'PRINT 'Starting data entry for vw_ODBC_mf_DiagnosisCodes'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_DiagnosisCodes SELECT LicenseKey, DiagnosisCode_UID, DiagnosisCode, InsuranceDescription, StatementDescription, DiagnosisXRef1, DiagnosisXRef2, DiagnosisXref3, Display, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_DiagnosisCodes where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_DiagnosisCodes', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_DiagnosisCodes is done!'PRINT 'Starting data entry for vw_ODBC_mf_DocumentTemplateExceptions'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_DocumentTemplateExceptions SELECT LicenseKey, DocumentTemplateException_UID, DocumentTemplateFID, PrinterName, AdjustLeftMargin, AdjustTopMargin, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_DocumentTemplateExceptions where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_DocumentTemplateExceptions', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_DocumentTemplateExceptions is done!'PRINT 'Starting data entry for vw_ODBC_mf_DocumentTemplates'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_DocumentTemplates SELECT LicenseKey, DocumentTemplate_UID, TemplateName, TemplateType, Description, FileName, FileLocation, DefaultDocumentName, DefaultDocumentDescription, DocumentContents, DocumentContentsChangedAt, AdjustLeftMargin, AdjustTopMargin, CountCharacters, CountCharsWSpaces, CountWords, CountLines, CountParas, CountPages, CreatedBy, CreatedAt, ChangedBy, ChangedAt, Display FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_DocumentTemplates where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_DocumentTemplates', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_DocumentTemplates is done!'PRINT 'Starting data entry for vw_ODBC_mf_DRGCodes'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_DRGCodes SELECT LicenseKey, DRGCode_UID, Code, Description, Display, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_DRGCodes where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_DRGCodes', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_DRGCodes is done!'PRINT 'Starting data entry for vw_ODBC_mf_DunningMessages'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_DunningMessages SELECT LicenseKey, DunningMessage_UID, DunningMessageCode, MessageDescription, Display, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_DunningMessages where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_DunningMessages', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_DunningMessages is done!'PRINT 'Starting data entry for vw_ODBC_mf_Employers'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_Employers SELECT LicenseKey, Employer_UID, EmployerCode, EmployerName, AptSte, Address, ZipCode, City, State, AreaCode, CountryCode, OfficePhone, OfficeExtension, ContactName, Email, User1, User2, User3, User4, Notes, WorkersCompCarrierFID, WorkersCompPolicyNumber, WorkersCompSubscriberFID, Display, NotesChangedAt, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_Employers where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_Employers', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_Employers is done!'PRINT 'Starting data entry for vw_ODBC_mf_Facilities'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_Facilities SELECT LicenseKey, Facility_UID, FacilityCode, FacilityName, AptSte, Address, ZipCode, City, State, AreaCode, CountryCode, ContactName, Email, FacilityType, FinancialSummaryFID, IncludeOnClaims, Display, LicenseNumber, UserFacilityID, FacilityNPI, XRefIDsChangedAt, FacilityTypeFID, BillClassFID, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_Facilities where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_Facilities', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_Facilities is done!'PRINT 'Starting data entry for vw_ODBC_mf_Facilities_s_XRefIDs'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_Facilities_s_XRefIDs SELECT LicenseKey, FacilityXRefID_UID, FacilityFID, CarrierFID, CarrierFacilityXrefIDNumber, Display, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_Facilities_s_XRefIDs where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_Facilities_s_XRefIDs', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_Facilities_s_XRefIDs is done!'PRINT 'Starting data entry for vw_ODBC_mf_FeeScheduleChargeCode'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_FeeScheduleChargeCode SELECT LicenseKey, FeeScheduleVersionFID, ChargeCodeFID, Amount, Display, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_FeeScheduleChargeCode where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_FeeScheduleChargeCode', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_FeeScheduleChargeCode is done!'PRINT 'Starting data entry for vw_ODBC_mf_FeeSchedules'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_FeeSchedules SELECT LicenseKey, FeeSchedule_UID, Description, Display, CreatedBy, CreatedAt, AmountType, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_FeeSchedules where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_FeeSchedules', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_FeeSchedules is done!'PRINT 'Starting data entry for vw_ODBC_mf_FeeScheduleVersions'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_FeeScheduleVersions SELECT LicenseKey, FeeScheduleVersion_UID, FeeScheduleFID, BeginDate, EndDate, Display, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_FeeScheduleVersions where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_FeeScheduleVersions', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_FeeScheduleVersions is done!'PRINT 'Starting data entry for vw_ODBC_mf_FileCategory'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_FileCategory SELECT FileCategory_UID, LicenseKey, CategoryCode, CategoryName, FileGroupFID, ApproveBy, Level, FileType, SystemFileType, Display, SystemCategory, CreatedAt, CreatedBy, ChangedAt, ChangedBy, DefaultCategory FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_FileCategory where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_FileCategory', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_FileCategory is done!'PRINT 'Starting data entry for vw_ODBC_mf_FileGroup'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_FileGroup SELECT LicenseKey, FileGroup_UID, GroupCode, GroupName FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_FileGroup where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_FileGroup', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_FileGroup is done!'PRINT 'Starting data entry for vw_ODBC_mf_FinancialClasses'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_FinancialClasses SELECT LicenseKey, FinancialClass_UID, FinancialClassCode, Description, RiskPercentage, RiskWriteOffCodeFID, AutoWriteOff, WriteOffCodeFID, AllowableWriteOffCodeFID, AcceptAssignment, Responsibility, BillInsurance, BillLab, DefaultAccountTypeFID, AccountReceivableFID, FinancialSummaryFID, AllowableFeeScheduleFID, Display, ChargeAllowable, CapWriteOff, CapWriteOffCodeFID, AllowSalesTax, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_FinancialClasses where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_FinancialClasses', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_FinancialClasses is done!'PRINT 'Starting data entry for vw_ODBC_mf_FollowUpInstructions'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_FollowUpInstructions SELECT LicenseKey, FollowUpInstruction_UID, FollowUpInstructionCode, Description, CreatedAt, CreatedBy, Display, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_FollowUpInstructions where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_FollowUpInstructions', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_FollowUpInstructions is done!'PRINT 'Starting data entry for vw_ODBC_mf_FormsLetters'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_FormsLetters SELECT LicenseKey, Form_UID, FormName, CreatedBy, CreatedAt, FormType, Display, ActualLetter, ActualLetterChangedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_FormsLetters where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_FormsLetters', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_FormsLetters is done!'PRINT 'Starting data entry for vw_ODBC_mf_HealthInformationCode'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_HealthInformationCode SELECT LicenseKey, HealthInformationCode_UID, HICode, Description, Type, Display FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_HealthInformationCode where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_HealthInformationCode', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_HealthInformationCode is done!'PRINT 'Starting data entry for vw_ODBC_mf_HipaaSituationalFields'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_HipaaSituationalFields SELECT LicenseKey, SituationalField_UID, Name, Description, Loop, SegmentPosition, ReferenceDesignator, Length, Display, CreatedAt, CreatedBy, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_HipaaSituationalFields where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_HipaaSituationalFields', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_HipaaSituationalFields is done!'PRINT 'Starting data entry for vw_ODBC_mf_HoldReason'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_HoldReason SELECT LicenseKey, HoldReason_UID, HoldReasonCode, Description, Display, CreatedAt, CreatedBy, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_HoldReason where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_HoldReason', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_HoldReason is done!'PRINT 'Starting data entry for vw_ODBC_mf_lnk_OfficeKeyGroup_LicenseKey'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_lnk_OfficeKeyGroup_LicenseKey SELECT OfficeKeyGroupFID, LicenseKey FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_lnk_OfficeKeyGroup_LicenseKey where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_lnk_OfficeKeyGroup_LicenseKey', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_lnk_OfficeKeyGroup_LicenseKey is done!'PRINT 'Starting data entry for vw_ODBC_mf_NoteTypes'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_NoteTypes SELECT LicenseKey, NoteType_UID, NoteTypeCode, Description, Display, CreatedAt, CreatedBy, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_NoteTypes where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_NoteTypes', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_NoteTypes is done!'PRINT 'Starting data entry for vw_ODBC_mf_OfficeKeyGroup'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_OfficeKeyGroup SELECT OfficeKeyGroup_UID, LicenseKey, OfficeKeyGroupName, Display, IsUserDefined, CreatedAt, CreatedBy, ChangedAt, ChangedBy, ManagedKeys FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_OfficeKeyGroup where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_OfficeKeyGroup', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_OfficeKeyGroup is done!'PRINT 'Starting data entry for vw_ODBC_mf_PaymentNote'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_PaymentNote SELECT LicenseKey, PaymentNote_UID, Code, Description, Display, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_PaymentNote where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_PaymentNote', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_PaymentNote is done!'PRINT 'Starting data entry for vw_ODBC_mf_PaymentReasons'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_PaymentReasons SELECT LicenseKey, PaymentReason_UID, Code, Reason, IncludeZeroDollar, ExcludeFromDenials, CreatedBy, CreatedAt, Display, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_PaymentReasons where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_PaymentReasons', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_PaymentReasons is done!'PRINT 'Starting data entry for vw_ODBC_mf_PGGroups'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_PGGroups SELECT LicenseKey, Group_UID, GroupCode, GroupName, AptSte, Address, ZipCode, City, State, AreaCode, CountryCode, License, FederalID, CLIANumber, NPINumber, UserFileFID, FeeScheduleFID, FinancialSummaryFID, AccountReceivableFID, PracticeFID, Display, XRefIDsChangedAt, CreatedBy, CreatedAt, ChangedBy, ChangedAt, Taxonomy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_PGGroups where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_PGGroups', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_PGGroups is done!'PRINT 'Starting data entry for vw_ODBC_mf_PGGroups_s_XRefIDs'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_PGGroups_s_XRefIDs SELECT LicenseKey, GroupXRefID_UID, GroupFID, CarrierFID, CarrierGroupXRefIDNumber, EnrolledDate, Display, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_PGGroups_s_XRefIDs where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_PGGroups_s_XRefIDs', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_PGGroups_s_XRefIDs is done!'PRINT 'Starting data entry for vw_ODBC_mf_PGPractice'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_PGPractice SELECT LicenseKey, Practice_UID, PracticeCode, PracticeName, AptSte, Address, ZipCode, City, State, AreaCode, CountryCode, OfficePhone, Fax, Other, PhoneType, Email, License, FederalTaxID, CLIANumber, UserFileFID, FinancialSummaryFID, AccountReceivableFID, Display, CompanyWebSite, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_PGPractice where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_PGPractice', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_PGPractice is done!'PRINT 'Starting data entry for vw_ODBC_mf_PGProfiles'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_PGProfiles SELECT LicenseKey, Profile_UID, ProfileCode, Description, AptSte, Address, ZipCode, City, State, AreaCode, CountryCode, OfficePhone, OfficeExtension, Fax, FacilityFID, License, FederalID, CLIANumber, UserFileFID, FeeScheduleFID, FinancialSummaryFID, AccountReceivableFID, ProviderFID, GroupFID, PracticeFID, ReferringProviderFID, StatementGroupFID, Display, BillAsFID, Taxonomy, NPINumber, XRefIDsChangedAt, IsDefault, HideInChargeEntry, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_PGProfiles where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_PGProfiles', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_PGProfiles is done!'PRINT 'Starting data entry for vw_ODBC_mf_PGProfiles_s_XRefIDs'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_PGProfiles_s_XRefIDs SELECT LicenseKey, ProviderXRefID_UID, ProfileFID, CarrierFID, CarrierProviderXrefIDNumber, EnrolledDate, Display, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_PGProfiles_s_XRefIDs where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_PGProfiles_s_XRefIDs', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_PGProfiles_s_XRefIDs is done!'PRINT 'Starting data entry for vw_ODBC_mf_PGProviders'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_PGProviders SELECT LicenseKey, Provider_UID, LastName, FirstName, MiddleName, Title, Cell, Pager, HomePhone, Email, FinancialSummaryFID, AccountReceivableFID, PracticeFID, Type, Status, IsInstitutional, PayScheduleFID, InactiveAt, InactiveBy, Display, UPINNumber, DEANumber, EMRAccess, EMRActiveAt, CreatedBy, CreatedAt, ChangedBy, ChangedAt, FullName FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_PGProviders where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_PGProviders', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_PGProviders is done!'PRINT 'Starting data entry for vw_ODBC_mf_PlaceOfService'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_PlaceOfService SELECT LicenseKey, POS_UID, POSDescription, POSValue, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_PlaceOfService where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_PlaceOfService', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_PlaceOfService is done!'PRINT 'Starting data entry for vw_ODBC_mf_PlaceOfService_Alias'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_PlaceOfService_Alias SELECT LicenseKey, Alias_UID, CarrierFID, POSAliasValue, PlaceOfServiceFID, Display, CreatedAt, CreatedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_PlaceOfService_Alias where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_PlaceOfService_Alias', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_PlaceOfService_Alias is done!'PRINT 'Starting data entry for vw_ODBC_mf_ProcChargeCodeCategories'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_ProcChargeCodeCategories SELECT LicenseKey, ChargeCodeCategory_UID, ChargeCategoryCode, Description, Display, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_ProcChargeCodeCategories where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_ProcChargeCodeCategories', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_ProcChargeCodeCategories is done!'PRINT 'Starting data entry for vw_ODBC_mf_ProcChargeCodes'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_ProcChargeCodes SELECT LicenseKey, ChargeCode_UID, ChargeCode, InsuranceDescription, StatementDescription, Units, PlaceOfServiceFID, TypeOfServiceFID, ChargeCodeCategoryFID, FollowUpInstructionFID, Tax, BillElectronically, RequireCLIANumber, FinancialSummaryFID, XRefBox1, XRefBox2, XRefBox3, XRefBox4, XRefBox5, XRefBox6, Display, AccountReceivableFID, DollarCopay, Note, BillInsurance, BillPatient, RevenueCodeFID, CustomRVU, CostCodeChargeCodeFID, ProcChargeCodeTypeFID, Left5XRefBox1, NDC, NDCDescription, CreatedBy, CreatedAt, ChangedBy, ChangedAt, UserFileFormFID FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_ProcChargeCodes where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_ProcChargeCodes', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_ProcChargeCodes is done!'PRINT 'Starting data entry for vw_ODBC_mf_ProcChargeCodeType'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_ProcChargeCodeType SELECT LicenseKey, ProcChargeCodeType_UID, Description FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_ProcChargeCodeType where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_ProcChargeCodeType', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_ProcChargeCodeType is done!'PRINT 'Starting data entry for vw_ODBC_mf_ProcModifierCodes'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_ProcModifierCodes SELECT LicenseKey, ModifierCode_UID, ModifierCode, Description, Display, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_ProcModifierCodes where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_ProcModifierCodes', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_ProcModifierCodes is done!'PRINT 'Starting data entry for vw_ODBC_mf_ProcPaymentCodes'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_ProcPaymentCodes SELECT LicenseKey, PaymentCode_UID, PaymentCode, Description, Display, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_ProcPaymentCodes where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_ProcPaymentCodes', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_ProcPaymentCodes is done!'PRINT 'Starting data entry for vw_ODBC_mf_ProcWriteOffCodes'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_ProcWriteOffCodes SELECT LicenseKey, WriteOffCode_UID, WriteOffCode, Description, Display, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_ProcWriteOffCodes where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_ProcWriteOffCodes', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_ProcWriteOffCodes is done!'PRINT 'Starting data entry for vw_ODBC_mf_ProviderFinancialClasses'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_ProviderFinancialClasses SELECT LicenseKey, ProfileFID, FinancialClassFID, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_ProviderFinancialClasses where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_ProviderFinancialClasses', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_ProviderFinancialClasses is done!'PRINT 'Starting data entry for vw_ODBC_mf_ProviderFinancialClassException'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_ProviderFinancialClassException SELECT ProviderFinancialClassException_UID, LicenseKey, ProfileFID, FinancialClassFID, FinancialClassCode, Description, RiskPercentage, RiskWriteOffCodeFID, AutoWriteOff, WriteOffCodeFID, AllowableWriteOffCodeFID, AcceptAssignment, Responsibility, BillInsurance, BillLab, DefaultAccountTypeFID, AccountReceivableFID, FinancialSummaryFID, AllowableFeeScheduleFID, Display, CapWriteOff, CapWriteOffCodeFID, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_ProviderFinancialClassException where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_ProviderFinancialClassException', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_ProviderFinancialClassException is done!'PRINT 'Starting data entry for vw_ODBC_mf_RecallDefaults'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_RecallDefaults SELECT LicenseKey, RecallDefault_UID, ApptTypeFID, ChargeSlipTemplateFID, NextApptTypeFID, NumberOf, DaysWeeksMonthsYears, CreatedBy, CreatedAt, Display, ProfileFID, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_RecallDefaults where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_RecallDefaults', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_RecallDefaults is done!'PRINT 'Starting data entry for vw_ODBC_mf_ReferralPlanSources'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_ReferralPlanSources SELECT LicenseKey, ReferralPlanSources_UID, Description, Display, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_ReferralPlanSources where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_ReferralPlanSources', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_ReferralPlanSources is done!'PRINT 'Starting data entry for vw_ODBC_mf_ReferralPlanStatusCodes'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_ReferralPlanStatusCodes SELECT LicenseKey, ReferralPlanStatus_UID, Description, Display, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_ReferralPlanStatusCodes where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_ReferralPlanStatusCodes', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_ReferralPlanStatusCodes is done!'PRINT 'Starting data entry for vw_ODBC_mf_ReferringProviders'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_ReferringProviders SELECT LicenseKey, ReferringProvider_UID, ReferringProviderCode, LastName, FirstName, MiddleName, Title, AptSte, Address, ZipCode, City, State, AreaCode, CountryCode, PracticeName, LicenseNumber, Speciality, Taxonomy, NPINumber, IncludeonHCFA, OfficePhone, Fax, Other, PhoneType, Email, UserFileFID, AccountReceivableFID, FinancialSummaryFID, Display, XRefIDsChangedAt, CreatedBy, CreatedAt, ChangedBy, ChangedAt, FullName FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_ReferringProviders where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_ReferringProviders', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_ReferringProviders is done!'PRINT 'Starting data entry for vw_ODBC_mf_ReferringProviders_s_XRefIDs'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_ReferringProviders_s_XRefIDs SELECT LicenseKey, ProviderXRefID_UID, ReferringProviderFID, CarrierFID, CarrierProviderXrefIDNumber, Display, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_ReferringProviders_s_XRefIDs where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_ReferringProviders_s_XRefIDs', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_ReferringProviders_s_XRefIDs is done!'PRINT 'Starting data entry for vw_ODBC_mf_RevenueCode'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_RevenueCode SELECT LicenseKey, RevenueCode_UID, RevenueCode, Description, RollUpOnClaim, Display, CreatedAt, CreatedBy, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_RevenueCode where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_RevenueCode', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_RevenueCode is done!'PRINT 'Starting data entry for vw_ODBC_mf_StatementGroups'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_StatementGroups SELECT LicenseKey, StatementGroup_UID, StatementGroupCode, UsePracticeSettings, StatementGroupName, AptSte, Address, ZipCode, City, State, CountryCode, OfficePhone, OfficeExtension, FederalTaxID, Display, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_StatementGroups where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_StatementGroups', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_StatementGroups is done!'PRINT 'Starting data entry for vw_ODBC_mf_TypeOfService'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_TypeOfService SELECT LicenseKey, TOS_UID, TosDescription, TosValue, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_TypeOfService where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_TypeOfService', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_TypeOfService is done!'PRINT 'Starting data entry for vw_ODBC_mf_TypeOfService_Alias'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_TypeOfService_Alias SELECT LicenseKey, Alias_UID, CarrierFID, TypeOfServiceFID, TOSAliasValue, Display, CreatedBy, CreatedAt, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_TypeOfService_Alias where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_TypeOfService_Alias', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_TypeOfService_Alias is done!'PRINT 'Starting data entry for vw_ODBC_mf_UserFileSelectList'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_UserFileSelectList SELECT UserFileSelectList_UID, LicenseKey, Name, OptionList, IsCMN, Display, CreatedAt, CreatedBy, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_UserFileSelectList where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_UserFileSelectList', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_UserFileSelectList is done!'PRINT 'Starting data entry for vw_ODBC_mf_UserFileSelectListOption'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_UserFileSelectListOption SELECT LicenseKey, UserFileSelectListFID, Value, Name, Ordinal FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_UserFileSelectListOption where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_UserFileSelectListOption', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_UserFileSelectListOption is done!'PRINT 'Starting data entry for vw_ODBC_mf_UserFileTemplateFields'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_UserFileTemplateFields SELECT UserFileTemplateField_UID, LicenseKey, UserFileTemplateFID, FieldName, Alias, Ordinal, DataType, Subtype, IsRequired, DefaultValue, NormalRangeLow, NormalRangeHigh, IncludeInList, IncludeInMailMerge, Display, CreatedAt, CreatedBy, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_UserFileTemplateFields where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_UserFileTemplateFields', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_UserFileTemplateFields is done!'PRINT 'Starting data entry for vw_ODBC_mf_UserFileTemplates'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_UserFileTemplates SELECT LicenseKey, UserFileTemplate_UID, TemplateCode, TemplateName, Ordinal, IsSingleUse, IncludeInMailMerge, IncludeOnFaceSheet, AlwaysShowOnFaceSheet, IncludeInDemographics, AlwaysShowInDemographics, RestrictUpdates, SystemType, SortByField1FID, SortByDesc1, SortByField2FID, SortByDesc2, FieldList, Display, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_UserFileTemplates where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_UserFileTemplates', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_UserFileTemplates is done!'PRINT 'Starting data entry for vw_ODBC_mf_UserFileValidation'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_UserFileValidation SELECT UserFileValidation_UID, LicenseKey, Name, RegEx, ErrorMsg FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_UserFileValidation where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_UserFileValidation', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_UserFileValidation is done!'PRINT 'Starting data entry for vw_ODBC_mf_ZipCodes'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_mf_ZipCodes SELECT LicenseKey, ZipCode_UID, ZipCode, City, State, CountryCode, AreaCode, Display, CreatedBy, CreatedAt, ChangedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_mf_ZipCodes where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_mf_ZipCodes', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_mf_ZipCodes is done!'PRINT 'Starting data entry for vw_ODBC_misc_HipaaRelationship'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_misc_HipaaRelationship SELECT LicenseKey, RelationshipCode, Description FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_misc_HipaaRelationship where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_misc_HipaaRelationship', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_misc_HipaaRelationship is done!'PRINT 'Starting data entry for vw_ODBC_misc_SelectList'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_misc_SelectList SELECT LicenseKey, SelectList_UID, Name, UseUID FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_misc_SelectList where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_misc_SelectList', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_misc_SelectList is done!'PRINT 'Starting data entry for vw_ODBC_misc_SelectListOption'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_misc_SelectListOption SELECT LicenseKey, SelectListOption_UID, SelectListFID, Value, Name, Ordinal FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_misc_SelectListOption where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_misc_SelectListOption', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_misc_SelectListOption is done!'PRINT 'Starting data entry for vw_ODBC_pt_FormBatch'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_pt_FormBatch SELECT LicenseKey, FormBatch_UID, Name, CreatedAt, CreatedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_pt_FormBatch where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_pt_FormBatch', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_pt_FormBatch is done!'PRINT 'Starting data entry for vw_ODBC_pt_FormsLetter'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_pt_FormsLetter SELECT LicenseKey, FormLetter_UID, CreatedBy, CreatedAt, Printed, TemplateFID, ActualLetter, PatientFID, Display FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_pt_FormsLetter where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_pt_FormsLetter', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_pt_FormsLetter is done!'PRINT 'Starting data entry for vw_ODBC_pt_InsuranceCoverages'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_pt_InsuranceCoverages SELECT LicenseKey, PatientInsuranceCoverage_UID, PatientFID, Active, SequenceNumber, EffectiveStartDate, EffectiveEndDate, CarrierFID, Coverage, SubscriberIDNumber, ResponsiblePartySubscriberFID, RelationshipPatienttoSubscriber, GroupName, GroupNumber, CopayDollarAmount, CopayPercentageAmount, AnnualDeductible, DeductibleAmountMet, YearEndMonth, LifeTimeBenefit, StudentStatus, NoteFID, BenefitInfoChangedAt, CreatedBy, CreatedAt, Display, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_pt_InsuranceCoverages where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_pt_InsuranceCoverages', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_pt_InsuranceCoverages is done!'PRINT 'Starting data entry for vw_ODBC_pt_InsuranceOrder'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_pt_InsuranceOrder SELECT LicenseKey, PatientFID, PatientInsuranceCoverageFID, Ordinal FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_pt_InsuranceOrder where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_pt_InsuranceOrder', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_pt_InsuranceOrder is done!'PRINT 'Starting data entry for vw_ODBC_pt_lnk_ReferralPlan_DiagnosisCodes'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_pt_lnk_ReferralPlan_DiagnosisCodes SELECT LicenseKey, ReferralPlanDiagnosisCode_UID, ReferralPlanFID, DiagnosisCodeFID FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_pt_lnk_ReferralPlan_DiagnosisCodes where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_pt_lnk_ReferralPlan_DiagnosisCodes', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_pt_lnk_ReferralPlan_DiagnosisCodes is done!'PRINT 'Starting data entry for vw_ODBC_pt_lnk_ReferralPlan_Notes'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_pt_lnk_ReferralPlan_Notes SELECT LicenseKey, ReferralPlanNote_UID, ReferralPlanFID, NoteFID FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_pt_lnk_ReferralPlan_Notes where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_pt_lnk_ReferralPlan_Notes', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_pt_lnk_ReferralPlan_Notes is done!'PRINT 'Starting data entry for vw_ODBC_pt_Memos'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_pt_Memos SELECT LicenseKey, Memo_UID, PatientFID, MemoType, MemoText, CreatedAt, CreatedBy, Display, ExpireDate, CarrierFID, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_pt_Memos where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_pt_Memos', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_pt_Memos is done!'PRINT 'Starting data entry for vw_ODBC_pt_Note'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_pt_Note SELECT LicenseKey, Note_UID, PatientFID, ProfileFID, NoteTypeFID, CreatedAt, Display, Note, CreatedBy, ChangedAt FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_pt_Note where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_pt_Note', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_pt_Note is done!'PRINT 'Starting data entry for vw_ODBC_pt_PatientInfo'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_pt_PatientInfo SELECT LicenseKey, Patient_UID, LastName, FirstName, MiddleName, ChartNumber, Title, AptSte, Address, ZipCode, City, State, AreaCode, CountryCode, OfficePhone, OfficeExtension, HomePhone, Other, PhoneType, Email, MaritalStatus, DOB, Deceased, Gender, SSN, Relationship, HIPAARelationship, ResponsiblePartyFID, ProfileFID, FinancialClassFID, Employer, EmployerFID, InsuranceOrder, AR_PatPortionFID, AR_InsPortionFID, CreatedAt, CreatedBy, Display, RecalcBuckets, FullName, ChangedAt, ChangedBy, BucketsUpdatedAt, BirthMonth, IsDeceased FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_pt_PatientInfo where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_pt_PatientInfo', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_pt_PatientInfo is done!'PRINT 'Starting data entry for vw_ODBC_pt_RecallVisits'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_pt_RecallVisits SELECT LicenseKey, RecallVisit_UID, PatientFID, ProfileFID, DateRecallRequested, RecallDueDate, RecallApptTypeFID, CreatedAt, CreatedBy, Display, AppointmentFID, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_pt_RecallVisits where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_pt_RecallVisits', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_pt_RecallVisits is done!'PRINT 'Starting data entry for vw_ODBC_pt_ReferralPlans'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_pt_ReferralPlans SELECT LicenseKey, ReferralPlan_UID, PatientFID, ReferralType, DefaultinChargeEntry, ByReferringProviderFID, ToReferringProviderFID, Reason, PreAuthCode, ExpirationDate, MaxCharge, UsedCharge, MaxAuthVisits, AuthVisitsUsed, ChargeCodeFID, StatusCodeFID, ReferralPlanSourceFID, FacilityFID, Display, PreAuthorizationRequired, CreatedAt, CreatedBy, SequenceNo, ChangedAt, ChangedBy, DiagnosisCodes FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_pt_ReferralPlans where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_pt_ReferralPlans', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_pt_ReferralPlans is done!'PRINT 'Starting data entry for vw_ODBC_pt_ResponsibleParties'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_pt_ResponsibleParties SELECT LicenseKey, ResponsibleParty_UID, AptSte, Address, ZipCode, City, State, AreaCode, CountryCode, Employer, LastName, FirstName, MiddleName, AccountTypeFID, OfficePhone, OfficeExtension, HomePhone, Other, PhoneType, Email, DOB, Gender, SSN, Title, EmploymentStatus, AR_RPPortionFID, AR_InsPortionFID, STMTFormatName, STMTFormsFID, OpenItemBFWD, SendSTMT, STMTRestartDate, STMTBillingCycle, FinanceCharge, CommunicateByEmail, LastActionHistoryFID, CreatedAt, CreatedBy, Display, ChangedAt, ChangedBy, BucketsUpdatedAt, FullName, HoldReasonFID FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_pt_ResponsibleParties where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_pt_ResponsibleParties', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_pt_ResponsibleParties is done!'PRINT 'Starting data entry for vw_ODBC_pt_Tickler'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_pt_Tickler SELECT LicenseKey, Tickler_UID, CreatedBy, CreatedAt, ChangedAt, ChangedBy, RemindDate, RemindNote, CompleteDate, PatientFID, RemindUser, Display, SeenDate FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_pt_Tickler where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_pt_Tickler', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_pt_Tickler is done!'PRINT 'Starting data entry for vw_ODBC_pt_UserFileInstances'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_pt_UserFileInstances SELECT UserFileInstance_UID, LicenseKey, PatientFID, UserFileTemplateFID, Display, CreatedAt, CreatedBy, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_pt_UserFileInstances where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_pt_UserFileInstances', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_pt_UserFileInstances is done!'PRINT 'Starting data entry for vw_ODBC_pt_UserFileValues'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_pt_UserFileValues SELECT UserFileValue_UID, LicenseKey, UserFileInstanceFID, UserFileTemplateFieldFID, FIDValue, TextValue, CreatedAt, CreatedBy, ChangedAt, ChangedBy FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_pt_UserFileValues where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_pt_UserFileValues', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_pt_UserFileValues is done!'PRINT 'Starting data entry for vw_ODBC_rpt_UnbilledClaims'--Set the start timeSET @DD = GETDATE()INSERT INTO vw_ODBC_rpt_UnbilledClaims SELECT LicenseKey, ChargeDetailFID, CarrierFID, ProfileFID, SubmitterFID, PaperFormFID, PrimaryOther, Reason, Display, EnableMonthlyBilling FROM OPENQUERY([OAK], 'SELECT * FROM vw_ODBC_rpt_UnbilledClaims where LicenseKey=117867')--Insert the time to run into the tableINSERT INTO ODBC_RunHistory VALUES( 1, @RunDate, 'vw_ODBC_rpt_UnbilledClaims', 'I', @DD, GETDATE(), CONVERT(varchar(100), GETDATE() - @DD, 14), @@ROWCOUNT)PRINT 'Data entry for vw_ODBC_rpt_UnbilledClaims is done!'-- Now print out a summary of what was loaded.SELECT * FROM ODBC_RunHistorySELECT 'Total run time: ' + CONVERT(varchar(100), (SELECT MAX(EndTime) FROM ODBC_RunHistory) - (SELECT MIN(BeginTime) FROM ODBC_RunHistory), 14), 'Total number of records: ' + CONVERT(varchar(100), (SELECT SUM(Rows) FROM ODBC_RunHistory)) |
 |
|
lionofdezert
Aged Yak Warrior
885 Posts |
Posted - 2011-02-24 : 07:25:53
|
khtan u have asked him to EXPLAIN now he did it ;)--------------------------http://connectsql.blogspot.com/ |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-02-24 : 08:16:11
|
yes. now i regret asking that  KH[spoiler]Time is always against us[/spoiler] |
 |
|
KenW
Constraint Violating Yak Guru
391 Posts |
Posted - 2011-02-25 : 16:08:08
|
quote: Originally posted by pramod21 Below code will fetch data from one particular databse.and will insert into our main database on server.i want it should compare sysdate with the latest data that has alreay inserted.so it will insert only those rows that are present after the latest date.for eg:i have latest data till 18 feb.and today is 24 feb.suppose if i m runing this query today.it should insert the data after the 18 feb.
You're kidding, right? Post the QUERY you're asking for help with, not the other hundreds of lines of TSQL. You can't seriously expect anyone to wade through all of that to try and locate the part your question might apply. |
 |
|
|
|
|