While working on this legacy VB6/SQL2000 project, I needed to add a new fields to a few tables. I also added a few new stored procedures.
When testing it later, I ran across an existing stored procedure blowing up. It contained the code:
INSERT INTO TheTable
SELECT *
FROM OPENXML(@DocHandle, '/XML/Stuff')
WITH TheTable
The "WITH" clause specifies the schema to use with the XML. Using a table name uses the same schema as the table. I added a non-null field to that table, but the XML passed in does not have that element, so I get a cryptic error:
OLE DB error trace [Non-interface error: Unexpected NULL value returned for the column: ProviderName='OpenXML', TableName='[OpenXML]', ColumnName='NewColumn'].
Source: Microsoft OLE DB Provider for SQL Server