title: Can I specify column types when creating an SQL Server view?
body: <p>Seeking to enforce more strict type safety and make it easier to detect mistakes, I would like to specify column types of my view explicitly.</p>
  
  <p>But while this works:</p>
  
  <pre><code>CREATE VIEW [dbo].[myview] (
      [a],
      [b],
      [c]
  )
  AS
  SELECT 'a1', 'b1', 'c1';
  </code></pre>
  
  <p>this fails:</p>
  
  <pre><code>CREATE VIEW [dbo].[myview] (
      [a] nvarchar(32) NOT NULL,
      [b] nvarchar(32) NOT NULL,
      [c] nvarchar(32) NOT NULL
  )
  AS
  SELECT 'a1', 'b1', 'c1';
  </code></pre>
  
  <p>Is there a correct syntax for this?</p>