select * from table where column1 = @variable
select * from table where column2 = @variable
select * from table where column1 = @variable OR (column1 IS NULL AND column2 = @variable)
select * from table where @variable = IsNull([Column1], [Column2])
select * from table where Case WHEN column1 is not null THEN column1 ELSE column2 END = @variable
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)