I've got the following (very simplified) stored procedure:
CREATE PROCEDURE [dbo].[sp_Search]
@MatchGender varchar(6)
AS
BEGIN
SELECT
*
FROM [tblUsers]
WHERE [UserGender] in (@MatchGender)
END
GO
I want to be able to match either Male, Female or both, so I'm using the "IN' clause.
When I test my stored procedure, I run the following:
exec [sp_Search] 'F'
Works fine. Now, how would I run that for both genders? When I try:
exec [sp_Search] ('F', 'M')
It doesn't work. What's the proper syntax? Please note, some of these matches have a couple dozen options, so assume a user can select 6 or 7 out of a possible 20. Not all of my variables are as simple as M/F).