I am trying to loop through 1 table and apply the values in from the dbo.SecTable into my dbo.Portfolio table so it returns every row contained dbo.SecTable for each individual account. I know I can union but the values in my dbo.SecTable are way too many to union.
Is there a way I loop through dbo.SecTable to link it to the dbo.Portfolio table and return each SecID and SecName for every one AcctID? Any assistance would be great!
select p. AcctID
from dbo.Portfolio p
from dbo.SecTable s