title: Can't use IF for create or alter view depending on view's existense
body: <p>I'm trying to achieve what the code below suggests, but I'm getting the error <code>Incorrect syntax near the keyword 'view'</code> on both the create and alter lines.  </p>
  
  <pre><code>IF Object_ID('TestView') IS NULL
      BEGIN
          create view TestView
          as
          . . .
      END
  ELSE
      BEGIN
          ALTER view TestView
          as
          . . .   
      END 
  </code></pre>