Using Null With Variable I have this table structure and am attempting to return the two rows where loglevel is null.  How should the query be written in order to return this?

Based off the sample DDL Below I want 2 rows for names returned:


  Pink Pig and Green Glove


  Declare @stuff Table
  (name varchar(50), vendorname varchar(100), vendorid varchar(10), loglevel varchar(10))
  Insert Into @stuff (name, vendorname, vendorid, loglevel) Values
  ('Pink Pig', 'Vendor 1', '214ac', NULL), ('Red Hat', 'Vendor 1', '214ac', '3')
  ,('Blue Sox', 'Vendor 1', '214ac', '3'), ('Green Glove', 'Vendor 1', '214ac', NULL)
  ,('Green Lantern', 'Vendor 2', 'Er23', '1'), ('Grey Goose', 'Vendor 2', 'Er23', '1')
  ,('Fox Fire', 'Vendor 2', 'Er23', NULL), ('Flyfish', 'Vendor 2', 'Er23', NULL)

  Declare @vendorid varchar(10), @loglevel varchar(10)
  Set @vendorid = '214ac';
  Set @loglevel = NULL

  Select * FROM @stuff
  WHERE vendorid = @vendorID
  AND loglevel = @loglevel
Try this.

Select * FROM @stuff
  WHERE vendorid = @vendorID
  AND loglevel Is Null