Please help me.
I want to create a dynamic search query in a stored procedure. The piece of code follows the query that I've written and run in the query builder but does not run when used from the C # code
My table name is info
with 3 columns, id int
, name nvarchar(50)
, family nvarchar(50)
.
SELECT Id, [name ], family, description
FROM info
WHERE (@n IS NULL) AND (@f IS NULL) OR
(@n IS NULL) AND (family = @f) OR
([name ] = @n) AND (@f IS NULL) OR
([name ] = @n) AND (family = @f)