Hi everyone!
Hope you can give me a hand with this little problem:
I am developing an advanced search page that searches for actors resumes on our website (ASP and SQL Server). On this page, I have a number of fields: drop-down lists, checkboxes, etc.
For example, I have a group of checkboxes that list sports that actors are capable of playing. There are about 30 checkboxes, and when checked, the value of each checkbox is added to a string, in which these values are separated by commas ("soccer,football,karate,volleyball,...". The problem is, I do not know exactly how many of these will be checked, but I need to develop a stored procedure that would get parameters from my ASP page and then return the results.
I thought of taking this string as a varchar parameter and then transform this string into a series of
colName LIKE '%soccer%' AND colName LIKE'%football%' AND ...
statements inside the stored procedure, but I am not sure if it can be done...
I also thought about extracting each of values from comma-separated string inside ASP code and then passing all thirty as parameters having default values, but along with other fields on the search page that would create a stored procedure with more than a hundred parameters, plus this approach is not scalable: each additional checkbox will require SQL code modifications.
Any ideas how it can be done?
I need to use sproc to be able to use server-side paging which seems to be much faster than client-side paging, since we can potentially have several thousand resumes... <Dmitriy>
dbrom@crosswinds.net
Hope you can give me a hand with this little problem:
I am developing an advanced search page that searches for actors resumes on our website (ASP and SQL Server). On this page, I have a number of fields: drop-down lists, checkboxes, etc.
For example, I have a group of checkboxes that list sports that actors are capable of playing. There are about 30 checkboxes, and when checked, the value of each checkbox is added to a string, in which these values are separated by commas ("soccer,football,karate,volleyball,...". The problem is, I do not know exactly how many of these will be checked, but I need to develop a stored procedure that would get parameters from my ASP page and then return the results.
I thought of taking this string as a varchar parameter and then transform this string into a series of
colName LIKE '%soccer%' AND colName LIKE'%football%' AND ...
statements inside the stored procedure, but I am not sure if it can be done...
I also thought about extracting each of values from comma-separated string inside ASP code and then passing all thirty as parameters having default values, but along with other fields on the search page that would create a stored procedure with more than a hundred parameters, plus this approach is not scalable: each additional checkbox will require SQL code modifications.
Any ideas how it can be done?
I need to use sproc to be able to use server-side paging which seems to be much faster than client-side paging, since we can potentially have several thousand resumes... <Dmitriy>
dbrom@crosswinds.net