Different results with procedure and query

  • Post the code

  • 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".

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 2 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply