Ramesh

Ramesh

  • NA
  • 81
  • 10.3k

check column is null or not null in conditional?

Aug 27 2022 1:19 PM

Hi everyone, how to check column is null or not null in conditional?
I need to convert Dynamic to Static SQL

Dynamic SQL:

IF @typeWeb = 1
       BEGIN
           SET @where = @where + ' AND p.Dealer is null '
       END
ELSE
IF @typeWeb = 0
       BEGIN
           SET @where = @where + ' AND p.Dealer is not null '
       END

How can i type this code?


Answers (3)