Dynamic SQL vs SP
Date: 01/21/08
(Asp Dot Net) Keywords: database, sql
My users need to search a database using an "advanced search" feature.
The advanced search feature has a number of parameters that the user can specify or not specify depending on their needs.
EG search by company name, city, state or search by company name & state or search by city & state
So some of the possible parameters could be blank.
In that case, am I better using dynamic SQL rather than a stored procedure ?
I know stored procedures run faster than dynamic SQL but the SP to handle all the possible permutations of search criteria will make the SP very difficult to write and maintain.
Source: http://community.livejournal.com/aspdotnet/94233.html