annotation issue with SQLXML - BulkLoad
  Home FAQ Contact Sign in
microsoft.public.sqlserver.xml only
 
Advanced search
POPULAR GROUPS

more...

microsoft.public.sqlserver.xml Profile…
 Up
annotation issue with SQLXML - BulkLoad         


Author: Travis McGee
Date: Aug 18, 2008 16:55

"Travis McGee" hotmail.com> wrote in message
news:eLS4%%23jYAJHA.1228@TK2MSFTNGP02.phx.gbl...
>I am getting "relationship expected on" errors on SQLXML Loading Code when
>I
> am creating the tables and then perhaps adding.inserting the data.
>
> Set oLoad = CreateObject("SQLXMLBulkLoad.SQLXMLBulkload.4.0")
> oLoad.ConnectionString = gsConn
> oLoad.ErrorLogFile = "c:\error.log"
> oLoad.SchemaGen = True
> oLoad.SGDropTables = False
> oLoad.BulkLoad = False
> oLoad.Execute "c:\schema1.xsd" , "c:\data1.xml"
>
> These files came from outsitde- many of them; for the purpose of bulk
> inserting into the database.
> What is the problem? Missing Annotation? Is SQLXML too picky?
> Why do we have to touch all of the Schema files? Are there two different
> standards?
> ...
Show full article (1.24Kb)
5 Comments
Re: annotation issue with SQLXML - BulkLoad         


Author: Jacob Sebastian
Date: Aug 18, 2008 19:33

Your schema should specify the name of the table to populate the data with.
In your case, it is missing. Look at the Bulk Load example here:
http://www.sqlserverandxml.com/2008/08/sqlxml-lab-2-basic-xml-bulk-load.html
and see the sql:relation element. It holds the name of the table to be
filled with the data from the XML document.

regards

--
Jacob Sebastian
SQL Server MVP
http://www.sqlserverandxml.com

"Travis McGee" hotmail.com> wrote in message
news:#MsAj4YAJHA.5632@TK2MSFTNGP04.phx.gbl...
> "Travis McGee" hotmail.com> wrote in message
> news:eLS4%%23jYAJHA.1228@TK2MSFTNGP02...
Show full article (1.81Kb)
no comments
Re: annotation issue with SQLXML - BulkLoad         


Author: Travis McGee
Date: Aug 18, 2008 22:36

yes, I kind of knew that.....
but if you haven't done this kind of stuff before... every single syntax
variation is a reason for another error; resulting with infinite trial and
errors.
Could you be kind enough to insert the relation element to the second xsd?

You have to understand, cookie-cutter example here and there is a bit
different than the files that we have here.
Will try to modify them tomorrow morning, but I bet something else will not
work.

The issue is that these files were created so that we could create the
tables and insert the data.
Why in the world that they don't have the correct annotation? Are there
seperate ways of loading xml data? One with anotated XML and one without,
just like the schema files we have.

Best regards
Lilya

"Jacob Sebastian" gmail.com> wrote in message
news:%%23CDPrPaAJHA.5096@TK2MSFTNGP02.phx.gbl...
> Your schema should specify the name of the table to populate the data
> with. In your...
Show full article (2.77Kb)
no comments
Re: annotation issue with SQLXML - BulkLoad         


Author: Jacob Sebastian
Date: Aug 19, 2008 05:40

I will try to help you with this (by modifying the second schema as you
requested)
Are you loading this data to a single table? Or you have a set or relational
tables where we need to load data based on certain relationship? or you don't
have the tables yet?

--
Jacob Sebastian
SQL Server MVP
http://www.sqlserverandxml.com

"Travis McGee" hotmail.com> wrote in message
news:OJsyB3bAJHA.1136@TK2MSFTNGP06.phx.gbl...
> yes, I kind of knew that.....
> but if you haven't done this kind of stuff before... every...
Show full article (3.30Kb)
no comments
RE: annotation issue with SQLXML - BulkLoad         


Author: Bob
Date: Aug 21, 2008 17:05

I got this revised schema1.xsd to work:

http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema">

Show full article (2.24Kb)
no comments
Re: annotation issue with SQLXML - BulkLoad         


Author: Travis McGee
Date: Aug 27, 2008 14:19

Thanks Bob,

I will experiment with this....but there are so many files to
modify.....nearly impossible; and I am sure there will be lots of other
glitches.

What is the main source of the problem????!!!
Standards issue? Version issue? Microsoft issue?

Still does not understand, when SQLXML Bulk Load creates the table, how will
it decide about the length of the type="xsd:string" /> for field. Usually the values will be truncated if it
picks SQL Server default value, without looking at the entire xml data file.
What am I missing here?

Best Regards
Lilya

"Bob" discussions.microsoft.com> wrote in message
news:1934263D-E61D-40C3-8A1E-9D3FD32CE1FB@microsoft.com...
>I got this revised schema1.xsd to work:
>
> http://www.w3.org/2001/XMLSchema"...
Show full article (3.03Kb)
no comments