Microsoft KB Archive/298990

= BUG: SQL Server XML Bulk Load Object Retains First Schema Information and Uses it For Subsequent Invocation of the Execute Method =

Article ID: 298990

Article Last Modified on 10/3/2003

-

APPLIES TO


 * Microsoft SQL Server 2000 Standard Edition

-



This article was previously published under Q298990



BUG #: 353837 (SHILOH_BUGS)



SYMPTOMS
When you invoke the Execute method of a SQLXMLBulkload object more than once with different schemas, the Execute method always uses the first schema parameter and ignores any new schema parameter. However, the Execute method does read the new XML data parameter. This behavior makes the SQLXMLBulkLoad Execute method inconsistent.



CAUSE
In some way, the SQLAMLBulkLoad object retains the table information that it got from the first XML schema. When the Execute method of the SQLXMLBulkload object is executed with a different schema, the SQLXMLBulkload object does not seem to read the new schema file but does read the XML data.



WORKAROUND
To make sure that a new table is created based on the corresponding XML schema, re-initialize the SQLXMLBulkload object or use the new SQLXMLBulkload object.



STATUS
Microsoft has confirmed this to be a problem in SQL Server 2000.



Steps to Reproduce Problem
Use the code that follows to demonstrate the problem: objBL.Execute &quot;c:\xmlSampleSchema.xml&quot;, &quot;C:\xml\SampleData.xml&quot; objBL.Execute &quot;c:\xmlSampleSchema2.xml&quot;, &quot;c:\xml\SampleData2.xml&quot;
 * When you first invoke the Execute method of the SQLXMLBulkload object, the schema is used and the data that corresponds to the first schema is inserted into the table specified in the schema as expected.


 * On any subsequent invocation of the Execute method of the SQLXMLBulkload object, the second schema is not used as you expect. Instead of creating a new table based on the second XML schema parameter that was just passed, the table specified in the first schema is re-created or re-used, depending upon whether the objBL.SchemaGen and objBL.SGDropTables properties are set on.

Keywords: kbbug kbpending KB298990

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.