title: IS NULL for variables in dynamic sql
body: <p>How can i dynamically create a view of rows with NULL values? There's a mistake in 'is null'.</p>
  
  <pre><code>insert into table1( name, surname,k) values ('Linkin', 'Park' , NULL)
  insert into table1( name, surname,k) values ('Jay', 'Z', NULL)
  
  declare @view varchar(60)='table1'
  declare @col varchar(150)='name, patronymic, surname'
  declare @column_name varchar(20)='k'
  declare @new_tname varchar(70)='table1'
  exec(N'create view['+ @view +']as select '+@col+' from [' + @new_tname +
  ']where ['+ @column_name + '] is null')
  </code></pre>