title: select one value from table to insert into new table plus other values
body: <p>I have this stored procedure that does not return <code>@RefereeId</code> with the <code>getRefereeId</code> output parameter. Any suggestions? I get nothing returned for <code>getRefereeId</code> when running this query</p>
  
  <pre><code>   @Email nvarchar(50),
     @AssignerId int,
     @RefereeId Int Output,
     @DateCreated Datetime,
     @Active bit,
     @Invitation bit
  as
  begin
      Select @RefereeId 
      From Referee 
      Where Email = @Email
  
      Insert Into Assignment (AssignerId, RefereeId, DateCreated, Active, Invitation) 
      Values (@AssignerId, @RefereeId, @DateCreated, @Active, @Invitation)
  End
  </code></pre>
  
  <p>VB code:</p>
  
  <pre><code>Dim strConn As String = "Data Source=mydatasource"
  Dim Conn As New SqlConnection(strConn)
  
  Dim Cmd As New SqlCommand("InviteReferee", Conn)
  Cmd.CommandType = CommandType.StoredProcedure
  
  Cmd.Parameters.Add(New SqlParameter("Email", newEmail.Text))        
  Cmd.Parameters.Add(New SqlParameter("Invitation", "True"))
  Cmd.Parameters.Add(New SqlParameter("Active", "False"))
  Cmd.Parameters.Add(New SqlParameter("AssignerId", AssignerId.Text))
  Cmd.Parameters.Add(New SqlParameter("DateCreated", DateTime.Now()))        
  
  Dim getRefereeId As SqlParameter = Cmd.Parameters.Add("@RefereeId", SqlDbType.Int)
  getRefereeId.Direction = ParameterDirection.Output
  
  Conn.Open()
  Cmd.ExecuteNonQuery()
  </code></pre>