title: What is N'@date referring to?
body: <p>Can anybody please help me to identify what the <code>N'@date</code> is referring to between the two set measures in the following exec statement? </p>
  
  <pre><code>declare @sql nvarchar(4000), @dt datetime;
  
  set @dt = '2015-10-01';
  
  set @sql = N'select * from dim_person
  
  where person_sid
  in
  (
  select max(person_sid)  from dim_person
  
  where [Effective_To] &lt;= @date
  
  group by person_id_number
  )';
  
  exec sp_executesql @sql, N'@date datetime',@dt;
  </code></pre>