Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C#, MY SQL hi everyone, I have a stored producers which is getting few row from

ID: 3819589 • Letter: C

Question

C#, MY SQL

hi everyone, I have a stored producers which is getting few row from the different table and left join to the second then will calculate and stored in the new table name, but when I run a program it just take first 10, and it does not go all the way to the end. and this is my code. is anyone can help me with this issue?

USE [CDR]
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER PROCEDURE [dbo].[RPT_Calculated_Get]
as
Begin
   select
       agentrangelist.Id                                       ,
agentrangelist.Serial                                   ,
agentrangelist.DebtorNumber                               ,
       agentRangeList.ExclusionFlag                           ,
agentrangelist.Flag1                                   ,
agentrangelist.ClientReferenceNumber                   ,
agentrangelist.ClientName                               ,
agentrangelist.ClientSSN                               ,
       agentRangeList.ClientID                                   ,
agentrangelist.ClientCode                               ,
agentrangelist.ClientRegion                               ,
agentrangelist.ClientState                               ,
agentrangelist.DebtorName                               ,
agentrangelist.InsuranceCompanyName                       ,
agentrangelist.AdjusterName                               ,
agentrangelist.AdmitDate                               ,
agentrangelist.DischargeDate                           ,
agentrangelist.PrincipleDue                               ,
agentrangelist.LastWorked                               ,
agentrangelist.Status                                   ,
agentrangelist.StatusClass                               ,
agentrangelist.Priority                                   ,
agentrangelist.Category                                   ,
agentrangelist.SequenceNumber                           ,
agentrangelist.DRG                                       ,
agentrangelist.Desk                                       ,
agentrangelist.LastLetter                               ,
agentrangelist.AssignDate                               ,
agentrangelist.InsuranceCompanySSN                       ,
BilledDate = agentrangelist.LastChargeDate               ,
PaidDate = agentrangelist.ClientDates2                   ,
BilledAmount = agentrangelist.BilledAmt                   ,
OriginalPayments = agentrangelist.Payments               ,
AdditionalPayments = agentrangelist.ReceivedTotal       ,
       AgentRangeList.TransactionDate                           ,
agentrangelist.Server                                   ,
agentrangelist.BottomLinePercentage                       ,
agentrangelist.AdjusterFax                               ,
agentrangelist.AdjusterPhone                           ,
agentrangelist.DebtorSSN                               ,
agentrangelist.Employer                                   ,
agentrangelist.ReviewDate                               ,
agentrangelist.InjuryDate                               ,
agentrangelist.BirthDate                               ,
agentrangelist.StatusDescription                       ,
agentrangelist.CategoryDescription                       ,
agentrangelist.Implants                                   ,
agentrangelist.PPRule                                   ,
       FirstScheduled = agentRangeList.[1stScheduled]           ,
       agentRangeList.PPStatusID                               ,                              
agentrangelist.TotalDeal                               ,
agentrangelist.Agent                                   ,
       agentrangelist.ClientTypeID                               ,
       agentrangelist.FlagByDebtorNumber                       ,
       agentrangelist.FlagBySSN                               ,
       agentrangelist.msrepl_tran_version                       ,
       agentrangelist.LastWorkedToday                           ,
       agentrangelist.OriginalInsuranceCompanyName              
   from AgentRangeList agentrangelist
   Left join RPT_AgentRangeList a on (
   agentrangelist.ClientCode = a.ClientCode
   and agentrangelist.DebtorNumber = a.DebtorNumber
and agentrangelist.ClientReferenceNumber = a.ClientReferenceNumber
   and agentrangelist.ClientName = a.ClientName
   and agentrangelist.ClientSSN = a.ClientSSN
   and agentrangelist.DebtorSSN = a.DebtorSSN
   and agentrangelist.DebtorName = a.DebtorName
   and agentrangelist.Employer = a.Employer
   and agentrangelist.InsuranceCompanyName = a.InsuranceCompanyName
   and agentrangelist.InsuranceCompanySSN = a.InsuranceCompanySSN
   and agentrangelist.AdjusterName = a.AdjusterName
   and agentrangelist.AdjusterPhone = a.AdjusterPhone
   and agentrangelist.AdjusterFax = a.AdjusterFax
   and agentrangelist.BottomLinePercentage = a.BottomLinePercentage
   and agentrangelist.AdmitDate = a.AdmitDate
   and agentrangelist.DischargeDate = a.DischargeDate
   and agentrangelist.PrincipleDue = a.PrincipleDue
   and agentrangelist.LastChargeDate = a.LastChargeDate
   and agentrangelist.ClientDates2 = a.ClientDates2
   and agentrangelist.InjuryDate = a.InjuryDate
   and agentrangelist.DRG = a.DRG
   and agentrangelist.Implants = a.Implants
   and agentrangelist.BilledAmt = a.BilledAmt
   and agentrangelist.Payments = a.Payments
   and agentrangelist.ReceivedTotal = a.ReceivedTotal
   )
   where a.Id is null
End

Explanation / Answer

Hello - I went through your code and did not find any logic issue with the procedure. There could be only one reason for getting only 10 values beacuse of where condition a.Id is null which might be filtering the records and probably you are having only 10 records into your AgentRangeList table satisfying the where condition. Please check the data into your table once.