title: TSQL parameter with NULL value does not enter IF condition
body: <p>I have a query that looks like this:</p>
  
  <pre><code>use [dbName]
  
  DECLARE @profile_id int
  SET @profile_id = 18
  DECLARE @test int
  
  SET @test = (SELECT user_profile_id FROM tbl_profiles WHERE id = @profile_id)
  
  SELECT @test as test
  
  if @test = NULL
      SELECT 1
  
  else 
      SELECT 2
  </code></pre>
  
  <p>I know that the value in the table is null, and I can see that @test is correctly being set to that value because the first SELECT shows:</p>
  
  <pre><code> |test
  1|NULL
  </code></pre>
  
  <p>However, in the IF condition the variable is not being treated as NULL because only the third SELECT is returned, showing:</p>
  
  <pre><code> |(no column name)
  1| 2
  </code></pre>
  
  <p>Why is that?</p>