Good links here:
Record Generation Process (SQLXML 4.0)
http://msdn.microsoft.com/en-us/library/ms172633.aspx
or here at the great W3 schools tutorials:
http://www.w3schools.com/schema/default.asp
Have a look through this set of replies I did recently. Although it's
fairly long and a bit painful at times, it does include an XML file with
relationships and an XSD I created showing the relationships:
http://forums.microsoft.com/msdn/ShowPost.aspx?PageIndex=2&SiteID=1&Pa...D=2&Pos
"Travis McGee" wrote:
> Have lots of xml files with data going into many many SQL tables, and the
> tables are not created.
>
> Also have xsd Schema files, but they are not "annotated"
>
> Can somebody point me to a good source that explains the "annotation" part
> of the xsd so that I can upload the data with code.
> The issue is that SQLXML Object for some reason does not like regular Schema
> files
>
> I want to/need to learn how to create xsd shema's with "relationships":
> sql:is-constant="1" ..... sql:relation="myTable" ....
> sql:field="myField" ....etc.
>
> Does anybody know a tool that can at least verify the validity of Schema
> files and/or can create SQLXML Friendly annotated XSD files, before I kill
> myself due to this issue.
>
> SSIS is no help.....not only I don't want to use SSIS with dozens of
> tables....SSIS replaces spaces in the XML nodes with an
> underscores.....really really painful task with weird error messages that
> makes absolutely no sense.
>
>
> Here is the code for the SQLXML - this part is usual straightforward
>
> Sub loadXmlOntario()
> Set oLoad = CreateObject("SQLXMLBulkLoad.SQLXMLBulkload.4.0")
> oLoad.ConnectionString = gsConn
> oLoad.ErrorLogFile = "c:\error.log"
> oLoad.SchemaGen = True
> oLoad.SGDropTables = True
> oLoad.BulkLoad = True
> 'Set oFs = CreateObject("Scripting.FileSystemObject")
> sPath = "\\10.0.0.105\e\rx\ontario"
> sSchema = "dataextract20080626New.xsd": sData = "data_extract_20080827.xml"
> oLoad.Execute sPath & "\" & sSchema, sPath & "\" & sData
> Set oLoad = Nothing
> End Sub
>
>
>