>I have two temporary tables in a stored prcedure that is used for reporting for a project of mine. What I want to do is look through table A and for all recrods NOT in table B add a new record to show zero sales. What is the best way to accomplish this?
Kelly,
Try
INSERT INTO #tablea
SELECT keyfield, 0, 0, 0, ...
FROM #tableb WHERE keyfield NOT IN (SELECT keyfield FROM @tablea)
--sb--