I want to set where condition for the select statement only if the param for procedure is not null
CREATE PROCEDURE spg_Proc(@ID INT)
--SELECT Statement with where condition if @ID not null
--SELECT Statement without where condition if @ID is null
I know we can check this with IF statement and do the desired operation, but i want to check the param is null or not within the SELECT statement itself, And add the condition to the select statement based on the param value.