How to check parameter has null or not in stored procedure
e.g
select * from tb_name where name=@name
i need to check if @name has values or null means.how to do it.thanks...
Is this what you want?
select * from tb_name where name=@name and @name is not null
Actually, the extra check is unnecessary, because NULL will fail any comparison. Sometimes, NULL is used to mean "get all of them". In that case, you want:
select * from tb_name where name=@name or @name is null
select * from tb_name where @name IS NULL OR name=@name