Can someone suggest how to add a condition in WHERE
clause of my stored procedure?
CREATE Procedure getAllEmployeesByDeptAndFlag
@Dept int,
@sal int,
@Flag int
AS
if @flag = 1
select *
from employee
where Department = @dept and @sal < 10000
else
select *
from employee
where Department = @dept
Is there any way to simplify above procedure?