title: Executing a simple stored procedure in SQL Server Management Studio
body: <p>This is a simple stored procedure written in SQL Server Management Studio.</p>
  
  <p>It compiles great but I have problems invoking it :(</p>
  
  <pre><code>CREATE PROCEDURE [dbo].[DetermineVoltage]
     @itemDescription varchar(225) ,
     @voltageRating varchar(225) OUTPUT
  AS
  BEGIN
     SELECT 
         @voltageRating = REVERSE(SUBSTRING(REVERSE(@itemDescription),
         charindex(' V', REVERSE(@itemDescription)) + 2,
      CHARINDEX(' ', REVERSE(@itemDescription), charindex(' V', REVERSE(@itemDescription)) + 1) - charindex(' V', REVERSE(@itemDescription)) - 2))
     RETURN
  END
  </code></pre>
  
  <p>In SQL Server Management Studio, when I execute this stored procedure like this:</p>
  
  <pre><code>DECLARE  @voltageRating VARCHAR(225) 
  exec dbo.DetermineVoltage['test 20V', @voltageRating]
  </code></pre>
  
  <p>I get an error </p>
  
  <blockquote>
    <p>Procedure or function 'DetermineVoltage' expects parameter '@voltageRating', which was not supplied.</p>
  </blockquote>
  
  <p>There are many SO answers which discusses the same error message but when executed from a C# program. </p>
  
  <p>But, in my case, how to execute a stored procedure within SQL Server Management Studio ?</p>