title: Incorrect syntax near the keyword 'AS' in procedure
body: <p>Why does my procedure give me: </p>
  
  <pre><code>Msg 156, Level 15, State 1, Procedure CountAantalModules, Line 10
  Incorrect syntax near the keyword 'AS'.
  </code></pre>
  
  <p>when I try to alter it?</p>
  
  <pre><code>USE [SomaData]
  GO
  /****** Object:  StoredProcedure [dbo].[CountAantalModules]    Script Date: 08/04/2011 15:09:09     ******/
  SET ANSI_NULLS ON
  GO
  SET QUOTED_IDENTIFIER ON
  GO
  
  ALTER PROCEDURE [dbo].[CountAantalModules]
  (
  @prodorder as int,
  @result int output
  )
  AS
  SET NOCOUNT ON;
  
  SELECT @result = COUNT(ORD.ORDERNUMMER) AS AantalModuleOrders
  FROM        Kostenposten AS KP
  INNER JOIN Orders AS ORD ON ORD.Ordernummer = KP.Ordernummer
  WHERE ((KP.KPNR = '170' AND KP.SOORT='LadeFront' OR KP.SOORT='GlasLadeFront') OR
  (KP.KPNR = '250' AND KP.SOORT='LadeFront')) AND ORD.PRODUCTIEORDER = (@prodorder)
  </code></pre>