title: Stored procedure parameter default value
body: <p>I'm trying to create a stored procedure with default parameters, in my query I would do it like this:</p>
  
  <pre><code>DECLARE @mydate DATETIME
  DECLARE @MT DATETIME
  DECLARE @MY DATETIME
  SELECT @mydate = GETDATE()
  SELECT @MT = DATEPART(MONTH,@mydate)
  SELECT @MY =  DATEPART(YEAR,@mydate)
  
  SELECT * FROM ....
  </code></pre>
  
  <p>In my stored proc I've tried it as follows but when I execute the stored proc it prompts me for parameter values:</p>
  
  <pre><code>USE ..
  GO
  ..
  ALTER PROCEDURE ...
  (@mydate DATETIME
  ,@MT DATETIME
  ,@MY DATETIME)
  
  AS
  BEGIN ...
  SELECT @mydate = GETDATE()
  SELECT @MT = DATEPART(MONTH,@mydate)
  SELECT @MY =  DATEPART(YEAR,@mydate)
  ---
  SELECT * FROM ....
  </code></pre>
  
  <p>How do I set the parameter values in the stored proc like I would in the query?</p>