i have a stored procedure with few params
the sp has query as follows
select * from register where code=@pcode and gender = @pgender and name like @pname+'%'
the user can enter all the 3 filter parameters or can choose any one
my issue is
if the user passes pname param and other 2 params are passed as dbnull i AM not getting the records
as my stmt wuld become
select * from register where code='' and gender = '' and name like A+'%'
but the stmt should be
select * from register where name like A+'%'