title: LINQ-to-SQL - The null value cannot be assigned to a member with type
body: <p>I have an issue with a LINQ query I am working on. This has worked perfect for a while, but we did a rollback of the database and now it doesn't work.</p>
  
  <p>Basically, I'm inserting a new row into a table which has an autogenerating BigInt PK. But when SubmitChanges is called I get this error:</p>
  
  <blockquote>
    <p>The null value cannot be assigned to a
    member with type System.Int64 which is
    a non-nullable value type</p>
  </blockquote>
  
  <p>I've looked at the generated SQL, and the issue seems to likely revolve arond this after the insert:</p>
  
  <blockquote>
    <p>SELECT CONVERT(BigInt,
    SCOPE_IDENTITY()) AS [value]</p>
  </blockquote>
  
  <p>This seems to be returning null, but I have no idea why. Both the table and the LINQ dmbl are set up correctly for autogenerating PK's. </p>
  
  <p>Any ideas?</p>
  
  <p>EDIT: After some debugging, including trying an insert manually in SQL as someone kindly suggested, I've stumbled upon a very strange issue -</p>
  
  <p>'Column or expression 'Outstanding' cannot be updated'</p>
  
  <p>Outstanding is a non-nullable decimal(9,2) field </p>