Pass where clause to a store procedure

  • From my one app, a dynamic where clause will generate like below.

    //where ordercity='london' and orderby='smith'

    //where orderamount > 100 and shipcity='new york'

    From server, I created a store procedure as below.

    SELECT * FROM [Order] WHERE @whereSql

    Help me to complete the store procedure so that I don't need to pass parameters one by one

  • Sounds vaguely like a catch all query, where parameters can be null and not all need to be specified to execute the stored proc

    Maybe Gail's article will help http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/

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

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