Get all records from inner joined tables if second table does not have data
I think the condition ON a.ID = ISNULL(b.ID,a.id) is not the best way to do this. It may lead to inefficient plans and may return unwanted results (according to your specifications). If the tblxyz table has rows with NULL values, you'll still get all the rows from table a (and possibly multiple times).

I would write the query without using the ISNULL() function, like this:

SELECT a.*
FROM tblabc a 
    INNER JOIN #tblxyz b 
    ON a.ID = b.ID 
    OR NOT EXISTS (SELECT * FROM #tblxyz) ;


or like this:

SELECT a.*
FROM tblabc a 
    INNER JOIN #tblxyz b 
    ON a.ID = b.ID 

UNION ALL

SELECT a.*
FROM tblabc a 
WHERE NOT EXISTS (SELECT * FROM #tblxyz) ;