473,407 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

SQL 2005 AND SQLXMLBulkLoad

Hi, Am I right in saying that by default, an element of complex type
in an XSD annotated schema maps to the table with the same name in the
specified database. If so does anyone have any idea why my app runs
with no errors, but doesn't add anything to the table in the DB. I was
hoping to find the value 'GDS-2392265' in the table.

Any Ideas?
Thanks in advance.
Rich
vb.net code
-----------------

Dim objBL
objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")
objBL.ConnectionString = "provider=SQLOLEDB.1;data source=xxx
\SQLEXPRESS;database=xxx;uid=sa;pwd=xxxxx"
objBL.ErrorLogFile = "c:\error.log"
objBL.KeepIdentity = False
objBL.Execute("c:\SCHEMA.XML", "c:\INPUT.XML")
objBL = Nothing

Me.Enabled = True
DB Table Def
-------------------

CREATE TABLE [dbo].[FeatureCollection](
[fid] [nchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
Schema File
------------------

<?xml version="1.0" ?>
<xsd:schema xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema"
xmlns:osgb="http://www.ordnancesurvey.co.uk/xml/namespaces/osgb"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<xsd:element name="FeatureCollection">
<xsd:complexType>
<xsd:attribute name="fid" type="xsd:string"/>
</xsd:complexType>
</xsd:element>

</xsd:schema>
XML File
------------

<?xml version='1.0' encoding='UTF-8'?>
<osgb:FeatureCollection
xmlns:osgb='http://www.ordnancesurvey.co.uk/xml/namespaces/osgb'
xmlns:gml='http://www.opengis.net/gml'
xmlns:xlink='http://www.w3.org/1999/xlink'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://www.ordnancesurvey.co.uk/xml/namespaces/
osgb http://www.ordnancesurvey.co.uk/xml/schema/v5/OSDNFFeatures.xsd'
fid='GDS-2392265'>
</osgb:FeatureCollection>

Feb 20 '07 #1
1 5496
On Feb 19, 5:02 pm, "rrowles2000" <rich...@rowles.co.ukwrote:
Hi, Am I right in saying that by default, an element of complex type
in an XSD annotated schema maps to the table with the same name in the
specified database. If so does anyone have any idea why my app runs
with no errors, but doesn't add anything to the table in the DB. I was
hoping to find the value 'GDS-2392265' in the table.

Any Ideas?
Thanks in advance.
Rich

vb.net code
-----------------

Dim objBL
objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")
objBL.ConnectionString = "provider=SQLOLEDB.1;data source=xxx
\SQLEXPRESS;database=xxx;uid=sa;pwd=xxxxx"
objBL.ErrorLogFile = "c:\error.log"
objBL.KeepIdentity = False
objBL.Execute("c:\SCHEMA.XML", "c:\INPUT.XML")
objBL = Nothing

Me.Enabled = True

DB Table Def
-------------------

CREATE TABLE [dbo].[FeatureCollection](
[fid] [nchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]

Schema File
------------------

<?xml version="1.0" ?>
<xsd:schema xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema"
xmlns:osgb="http://www.ordnancesurvey.co.uk/xml/namespaces/osgb"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<xsd:element name="FeatureCollection">
<xsd:complexType>
<xsd:attribute name="fid" type="xsd:string"/>
</xsd:complexType>
</xsd:element>

</xsd:schema>

XML File
------------

<?xml version='1.0' encoding='UTF-8'?>
<osgb:FeatureCollection
xmlns:osgb='http://www.ordnancesurvey.co.uk/xml/namespaces/osgb'
xmlns:gml='http://www.opengis.net/gml'
xmlns:xlink='http://www.w3.org/1999/xlink'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://www.ordnancesurvey.co.uk/xml/namespaces/
osgbhttp://www.ordnancesurvey.co.uk/xml/schema/v5/OSDNFFeatures.xsd'
fid='GDS-2392265'>
</osgb:FeatureCollection>
Hi -

Got this information from a GML guru. Not sure if it helps, but
perhaps worth a try:

Looks like the SQLXMLBulkLoad utility only wants to load the
"default"
namespace (i.e. no prefix). So, simply make GML the the default
namespace:

<MyFeatureCollection xmlns="http://www.opengis.org/gml" ... >
....
</MyFeatureCollection>

This way any "unqualified" elements are assumed to be in the gml
namespace and, presumably, SQLXMLBulkLoad would load the data.

Regards

Carl

Feb 20 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: richard | last post by:
Hi, I'm using 2005 and SQLXMLBulkLoad to load some rather large gml files. But I've got a problem (I Think) with specifying different namespaces. I'm a bit new to all this so your patience is...
2
by: teakwood85 | last post by:
Hello everyone, I'm trying to use SQLXMLBulkLoad component in c#, when i read some articles, they said that I need to add com components, named "xblkld3.dll" (Interop.SQLXMLBULKLOADLib) Ref: ...
1
by: Shilpa Ginode | last post by:
Hi All, I have a problem regarding SQLXMLBulkLoad.3.0 and the DSN connection. I have created a object of SQLXMLBulkLoad.3.0 in my DTS package. The connection for this object is DSN connection....
0
by: raysot | last post by:
I am a total nube with XML and am struggling with a simple XML import into SQL 2005. Lots of boring code to follow: (In short though, my basic question is this: What in the world are my tables...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.