As you can see in the above screenshot, this query provides a parallel insert:
INSERT INTO #StateAllocationData WITH (TABLOCK)
(ProjectID,StateId,StateLineDescriptionId,PartnerID,Value)
SELECT @ProjectID as ProjectID,sld.StateId,sld.ID,TaxReturnPartnerNumber,0 as Value
FROM Meta.States S(NOLOCK)
LEFT JOIN Meta.StateAllocationLineDescriptions SLD(NOLOCK) ON S.StateId = SLD.StateId
join Ottp.PartnerData PD on ProjectID=@Projectid
WHERE SLD.isDeleted = 0 AND SLD.ID IS NOT NULL
However, as you can see in the above screenshot, this query doesn't do the parallel insert, and I'm wondering why:
INSERT INTO #SAmt WITH (TABLOCK) (ProjectID,StateId,K1SummaryID,StateLineDescriptionId)
SELECT @ProjectID AS 'ProjectID',
S.StateId,
SLD.StateLineDescriptionId AS 'K1SummaryID',
SLD.ID AS 'StateLineDescriptionId'
FROM Meta.States S(NOLOCK)
LEFT JOIN Meta.StateAllocationLineDescriptions SLD(NOLOCK) ON S.StateId = SLD.StateId
WHERE --SLD.isK1Summary <> 0 and
SLD.isDeleted = 0
AND SLD.ID IS NOT NULL