title: stored procedure input parameter
body: <p>i am creating a stored procedure in sql server 2008 such as this</p>
  
  <pre><code>-- the code
  create procedure proce
  @database varchar(50)
  as
  begin
  select * from [@database].[dbo].[sometable]
  end
  </code></pre>
  
  <p>the procedure is compiled</p>
  
  <p>but when i execute the procedure using </p>
  
  <pre><code>-- here i execute it
  execute proce 'somedatabase'
  </code></pre>
  
  <p>it throws an error </p>
  
  <pre><code>-- me gets error :(
  Invalid object name '@database.dbo.sometable'
  </code></pre>
  
  <p>where am i going wrong???????</p>