I have the temp table #ProviderReportCardTable_MeasureCounts that gets populated in my stored procedure in a step before the below code. I have confirmed that it does include all of the data that I want.
Then I have another temp table that is created #ProviderReportCardTable_MeasureCountsFINAL in another step that inserts some basic details (what I use in the join below) which does work and then the rest of it is supposed to be updated based on a join.
The problem is that none of the fields that are supposed to be updated get a value. They remain NULL. Can you update a temp table from another temp table? I have been searching for examples and I have not found one.
Update #ProviderReportCardTable_MeasureCountsFINAL
Set
AMI1Passed = p.AMI1Passed
,AMI1Failed = p.AMI1Failed
,AMI1Total = p.AMI1Total
,AMI2Passed = p.AMI2Passed
,AMI2Failed = p.AMI2Failed
,AMI2Total = p.AMI2Total
from #ProviderReportCardTable_MeasureCounts p
join #ProviderReportCardTable_MeasureCountsFINAL f on f.QtrDesc = p.QtrDesc and f.MorriseyID = p.MorriseyID
Then I have another temp table that is created #ProviderReportCardTable_MeasureCountsFINAL in another step that inserts some basic details (what I use in the join below) which does work and then the rest of it is supposed to be updated based on a join.
The problem is that none of the fields that are supposed to be updated get a value. They remain NULL. Can you update a temp table from another temp table? I have been searching for examples and I have not found one.
Update #ProviderReportCardTable_MeasureCountsFINAL
Set
AMI1Passed = p.AMI1Passed
,AMI1Failed = p.AMI1Failed
,AMI1Total = p.AMI1Total
,AMI2Passed = p.AMI2Passed
,AMI2Failed = p.AMI2Failed
,AMI2Total = p.AMI2Total
from #ProviderReportCardTable_MeasureCounts p
join #ProviderReportCardTable_MeasureCountsFINAL f on f.QtrDesc = p.QtrDesc and f.MorriseyID = p.MorriseyID