OK, I have managed to create a "repro" script.
Just download the following:
http://www.eazign.be/Temp/SqlRepro.sql.zip
Contains only 1 file: SqlRepro.sql
Run this script on any SQL Server 2008 (I use the Standard version).
What the script does:
1. Create a new database: "FdmSqlRepro" (drops it first if already exists)
2. Create a schema collection: "MySchemaCollection"
3. Create a table: "TestTable", with a numeric "idx" column and a typed xml
column "xData". The xml column is bound to the created "MySchemaCollection"
4. Insert 1 record in the table
5. Query the table (SELECT * FROM TestTable)
That's all!
The last step (query *) gives the error:
"Index was outside the bounds of the array."
Can anyone run this script and confirm they get the same error?
And then of course: why does it happen ... ? Any workarounds?
Many thanks in advance,
Hopefully my question is a little more documented now