Advertisement

04.18.2008 at 09:00AM PDT, ID: 23334598 | Points: 125
[x]
Attachment Details

With SQL Bulk Load, how do I load one input field into two columns in the same table?

Asked by jschremp in MS SQL Server, Extensible Markup Language (XML), XML Schemas for .Net

Tags: SQL Bulk Load - XSD

I'm using SQL Bulk Load with SQL Server 2000, to load an XML file into a table in the database.   There is one input field that I want to load into two different columns in my table.  But I can't figure out how to set up the XSD file to do this.  

I've tried specifying the element twice with two different sql fields:
      <xsd:element name="Id" type="xsd:string" sql:field="AccountId"/>
      <xsd:element name="Id" type="xsd:string" sql:field="FolderId"/>
This gave the following error:
Schema: unable to load schema...  An error occurred... The element: 'Id' in <all> is already defined.

I've also tried specifying the element once with two different sql fields:
      <xsd:element name="Id" type="xsd:string" sql:field="AccountId" sql:field="FolderId"/>
This gave the following error:
Duplicate attribute.

Any help would be appreciated.  Thanks!Start Free Trial
[+][-]04.18.2008 at 09:12AM PDT, ID: 21387132

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.18.2008 at 09:36AM PDT, ID: 21387392

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.18.2008 at 09:51AM PDT, ID: 21387529

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.18.2008 at 02:27PM PDT, ID: 21389772

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2008 at 10:45AM PDT, ID: 21393317

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628