incorrect syntax near the keyword 'end'. sql
<pre><code>ALTER procedure [dbo].[proc_PostVisitCountInsert](
@postCount bigint,
@postID bigint)
as
 Begin
  if not exists(select * from PostVisitCount where postID=@postID)
   Begin
    Insert into PostVisitCount(postcount,postID) values(@postCount, @postID)
   end   
  else
    Begin
     --Query for Update PostVisitCount
       Declare @count bigint
       Set @count=(select postcount from PostVisitCount where postID=@postID)
       Update PostVisitCount set postcount=(@count+1), postID=@postID
    End 
 end --Error getting at this place
</code></pre>

<p>When I try to execute the query, I'm getting error with these query. I don't understand what is wrong with this query any one helps me to figure out what did I do wrong.</p>