title: error in EXECUTE sp_executesql
body: <p>when i execute this query, i get error of 'Incorrect syntax near the keyword 'VIEW''
  please help me, what is the problem in this query?</p>
  
  <pre><code>EXECUTE sp_executesql 
  N'
  CREATE VIEW LastDayOfMonth
  AS
  SELECT @MAX = MAX(DATEPART(DAY,CurrencyRateDate))AS CurrencyRateDate FROM Sales.CurrencyRate 
  WHERE 
  DATEPART(YEAR,CurrencyRateDate)=@YEAR
  AND
  DATEPART(MONTH,CurrencyRateDate)= @MONTH',
  N' @YEAR CHAR(4),@MONTH CHAR(2)',
  @YEAR = '2004',
  @MONTH = '02';
  </code></pre>