title: Cannot insert value NULL into column, but values in error message have nothing to do with my code
body: <p>I have a VB.NET program that calls a stored procedure in SQL Server which inserts data into a table. Upon running this code, I get the following error message:</p>
  
  <blockquote>
    <p>Msg 515, Level 16, State 2, Procedure uspAddSponsor, Line 19 [Batch Start Line 406]<br>
    Cannot insert the value NULL into column 'intGenderID', table 'dbSQL1.dbo.TGolfers'; column does not allow nulls. INSERT fails.</p>
  </blockquote>
  
  <p>The problem is that neither <code>intGenderID</code> nor <code>TGolfers</code> are referenced in the stored procedure. </p>
  
  <p>Here is my stored procedure code:</p>
  
  <pre><code>CREATE PROCEDURE uspAddSponsor
      --@intGolferID              AS INTEGER OUTPUT
      @strFirstName AS VARCHAR(255),
      @strLastName AS VARCHAR(255),
      @strStreetAddress AS VARCHAR(255),
      @strCity AS VARCHAR(255),
      @strState AS VARCHAR(255),
      @strZip AS VARCHAR(255),
      @strPhoneNumber AS VARCHAR(255),
      @strEmail AS VARCHAR(255)
  AS
      SET XACT_ABORT ON
  
  BEGIN TRANSACTION
  
      INSERT INTO TSponsors (strFirstName, strLastName, strStreetAddress, strCity, strState, strZip, strPhoneNumber, strEmail)
      VALUES (@strFirstName, @strLastName, @strStreetAddress, @strCity, @strState, @strZip, @strPhoneNumber, @strEmail)
  
      COMMIT TRANSACTION
  GO
  </code></pre>
  
  <p>Here is the code used to call the stored procedure:</p>
  
  <pre><code>EXECUTE uspAddSponsor 'Joe', 'Johnson', '420 Main St', 'Ashton Park', 'IN', '46225', '5136656969', 'jjohnson@gmail.com' 
  </code></pre>
  
  <p>Here's the sticky part. Running the INSERT statement by itself works with no problems. However, executing the stored procedure, which features the exact same <code>INSERT</code> statement, causes the error above. I truly have no idea what's going on. </p>
  
  <p>There's no foreign key linking TGolfers and TSponsors. TSponsors doesn't even have an intGenderID column. I have no idea what could be causing this. </p>
  
  <p>Thanks for any help!</p>