• Note, this isn't just about the WHERE clause. You can also potentially eliminate complete hits (joins) on tables if you don't actually need to filter on them based on input parameters.

    I am wondering - why are you looking to get rid of a java process that already creates the proper (assuming it does) dynamic SQL?

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service