title: SQL Server 2008 create procedure and create view
body: <p>I was trying to create a view and a procedure. However none of them can be done. </p>
  
  <p>I have tried creating the procedure like this:</p>
  
  <pre><code>create procedure name ( @time )
  as 
  begin
      select tag_ID from Location where tag_ID=@time;
  end
  
  create procedure name 
  as 
      select tag_ID from Location where tag_ID=@time;
  end
  </code></pre>
  
  <p>Both result in the following error </p>
  
  <blockquote>
    <p>Major Error 0x80040E14, Minor Error 25501
    create procedure name 
    as 
    select tag_ID from Location where tag_ID=@time
    There was an error parsing the query. [ Token line number = 1,Token line offset = 8,Token in error = procedure ]</p>
  </blockquote>
  
  <p>For creating view </p>
  
  <pre><code>create view Time as select time from Location;
  </code></pre>
  
  <p>The error I received is:</p>
  
  <blockquote>
    <p>Major Error 0x80040E14, Minor Error 25501
    create view Time as select time from Location
    There was an error parsing the query. [ Token line number = 1,Token line offset = 8,Token in error = view ]</p>
  </blockquote>
  
  <p>It seems to be some problem in using the CREATE, however i cannot figure it out. </p>
  
  <p>I have tried most of the syntax but it seems not working, most of them pop out the same error. </p>
  
  <p>** I am using SQL compact edition.</p>