title: SQL Server stored procedure with empty body
body: <p><a href="https://msdn.microsoft.com/en-us/library/ms187926.aspx" rel="noreferrer">CREATE PROCEDURE</a> syntax:</p>
  
  <pre><code>CREATE { PROC | PROCEDURE } [schema_name.] procedure_name [ ; number ]   
      [ { @parameter [ type_schema_name. ] data_type }  
          [ VARYING ] [ = default ] [ OUT | OUTPUT | [READONLY]  
      ] [ ,...n ]   
  [ WITH &lt;procedure_option&gt; [ ,...n ] ]  
  [ FOR REPLICATION ]   
  AS { [ BEGIN ] sql_statement [;] [ ...n ] [ END ] }  
  [;]  
  
  
  &lt;sql_statement&gt; ::=   
  { [ BEGIN ] statements [ END ] }  
  </code></pre>
  
  <blockquote>
    <p><strong>[ ]</strong> (brackets)    <strong>Optional syntax items.</strong> Do not type the brackets.</p>
    
    <p><strong>{ }</strong> (braces)  <strong>Required syntax items.</strong> Do not type the braces.  </p>
  </blockquote>
  
  <p>And human readable form:</p>
  
  <p><a href="https://i.stack.imgur.com/wgf0n.png" rel="noreferrer"><img src="https://i.stack.imgur.com/wgf0n.png" alt="enter image description here"></a></p>
  
  <p>Let's try to write stored procedure with empty body:</p>
  
  <pre><code>CREATE PROC my_proc AS
  
  -- please treat it as separate call, for example with different session
  EXEC my_proc
  </code></pre>
  
  <p>is perfect valid syntax.</p>
  
  <p><kbd><strong><a href="http://rextester.com/IRRHZ62887" rel="noreferrer"><code>LiveDemo</code></a></strong></kbd></p>
  
  <p>So it looks like that <code>sql_statement</code> could be empty.</p>
  
  <p>Now let's try the same with but this time with <code>BEGIN/END</code> block:</p>
  
  <pre><code>CREATE PROC my_proc AS
  BEGIN
  END
  -- Incorrect syntax near 'END'.
  </code></pre>
  
  <p><kbd><strong><a href="http://rextester.com/TPN49602" rel="noreferrer"><code>LiveDemo2</code></a></strong></kbd></p>
  
  <p>Why is the first example valid? If <code>sql_statement</code> allows nothing then second example should work too  or the doc is inaccurate.</p>
  
  <p><strong>EDIT</strong></p>
  
  <blockquote>
    <p>well, that's because in the first example it isn't an empty body, your sp will be: EXEC my_proc</p>
  </blockquote>
  
  <p>The case was to show that I could call SP. But you could add <code>GO</code> or use <code>EXEC</code>:</p>
  
  <pre><code>CREATE PROC my_proc AS
  GO
  
  EXEC my_proc
  </code></pre>
  
  <p>or</p>
  
  <pre><code>EXEC('CREATE PROC my_proc AS')
  
  EXEC my_proc
  </code></pre>
  
  <p><kbd><strong><a href="http://rextester.com/NIE90805" rel="noreferrer"><code>LiveDemo3</code></a></strong></kbd></p>