Hi Patrick,
You can do somethink like this by script with cursors, loop, array BUT your description points just to a simple LEFT OUTER JOIN of table XYZ against ABC.
Link the two tables and project all XYZ data and a column of ABC table. Your new column FLAG can be created with a test of ISNULL of ABC table.
Best regards, Fernando Da Rós