Also, look at the execution plans, specifically the ANSI settings (located in the first operator's properties). See if they're different. That could result in differences in data depending on the query and the settings. Also, just compare the plans to see what/how/why the optimizer is putting things together. At the core of it all, they can't be identical. Something is different, not just "in a proc"/"as a batch".