Showing posts with label xml. Show all posts
Showing posts with label xml. Show all posts

Sunday, March 25, 2012

Can Visual Studio map SQL Server to XSD Schema?

I am creating an annual XML document to submit to a government agency. They have published an XSD Schema. Our data is in SQL Server 2000.

I need some way of associating columns from tables in SQL Server 2000 with the elements from the XSD schema to produce a valid XML document.

It looks like I could use XMLSpy or Stylus Studio, but I think there must be some way of doing it in Visual Studio 2005. Does Visual Studio 2005 have tools to help me do this? Can anyone direct me to a WebCast or part of the documentation that would dexplain I can do this?

(P.S. If you are curious, this is for the CDFI CIIS)

SQLXML has support for mapping between SQL Server and XSD using annotations in the XSD schema. There is no tool to visualize the mapping. Here is an overview of mapping schemas:

http://msdn2.microsoft.com/en-us/library/ms171870(SQL.90).aspx

This article is about SQLXML 4, but also applies to SQLXML 3 which is available on msdn:

http://www.microsoft.com/downloads/details.aspx?FamilyID=51D4A154-8E23-47D2-A033-764259CFB53B&displaylang=en

|||Thank you for your response-- I'll check out the links.

Can Visual Studio map SQL Server to XSD Schema?

I am creating an annual XML document to submit to a government agency. They have published an XSD Schema. Our data is in SQL Server 2000.

I need some way of associating columns from tables in SQL Server 2000 with the elements from the XSD schema to produce a valid XML document.

It looks like I could use XMLSpy or Stylus Studio, but I think there must be some way of doing it in Visual Studio 2005. Does Visual Studio 2005 have tools to help me do this? Can anyone direct me to a WebCast or part of the documentation that would dexplain I can do this?

(P.S. If you are curious, this is for the CDFI CIIS)

SQLXML has support for mapping between SQL Server and XSD using annotations in the XSD schema. There is no tool to visualize the mapping. Here is an overview of mapping schemas:

http://msdn2.microsoft.com/en-us/library/ms171870(SQL.90).aspx

This article is about SQLXML 4, but also applies to SQLXML 3 which is available on msdn:

http://www.microsoft.com/downloads/details.aspx?FamilyID=51D4A154-8E23-47D2-A033-764259CFB53B&displaylang=en

|||Thank you for your response-- I'll check out the links.

Sunday, March 11, 2012

Can SSIS work with an XML web service? (Verisign Payflow Pro)

I'm trying to figure out a solution for posting financial transactions against our Payflow Pro (Verisign) payment gateway (web service) using SSIS. The process I have in my mind goes like this...

1.) Select the appropriate records from our financial system DB.

2.) Iterate through each record and post the pertinent values against the payment gateway web service.

3.) Create log files for successful and failed transactions.

The log files would then be manually imported into our financial system.

Thanks in advance.

There is no web service or XML data flow destination, unfortunately. You could write a custom destination component to call your web service.|||

jwelch wrote:

There is no web service or XML data flow destination, unfortunately. You could write a custom destination component to call your web service.

Not entirely true... You can stick a Web service task in a foreach loop that spins through the recordset. Then you merely map the appropriate variables to the Web service.

This is done on the control flow, though, so you'd need to perhaps stage your data first in the data flow and then select it with an Execute SQL task to load up your ADO recordset.|||My bad, I was focused on the data flow. Good approach.|||Great info! I'll look into that.

Can tags be duplicated?

My xml file has the tags in the below format.
say :
<country>
<city>
<st>
<no>5</no>
</st>
</city>
<village>
<st>
<no>4</no>
</st>
</village>
</country>
Can the tag <st> be present within 2 different parents?
If yes, how do I differentiate <st> in each case?
Regards
MeenakshiMeenakshi wrote:

> Can the tag <st> be present within 2 different parents?
Yes, of course.

> If yes, how do I differentiate <st> in each case?
Do you want to write a schema for that XML? Or do you want to query the XML?
Martin Honnen -- MVP XML
http://JavaScript.FAQTs.com/|||I need to write a scema for that XML.
How do I do that?
Regards
Meena
"Martin Honnen" <mahotrash@.yahoo.de> wrote in message
news:OM5sj5JwHHA.4528@.TK2MSFTNGP03.phx.gbl...
> Meenakshi wrote:
>
> Yes, of course.
>
> Do you want to write a schema for that XML? Or do you want to query the
> XML?
> --
> Martin Honnen -- MVP XML
> http://JavaScript.FAQTs.com/|||Meenakshi wrote:
> I need to write a scema for that XML.
> How do I do that?
Here is an example schema that inlines the element definitions:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
<xs:element name="country">
<xs:complexType>
<xs:sequence>
<xs:element name="city">
<xs:complexType>
<xs:sequence>
<xs:element name="st">
<xs:complexType>
<xs:sequence>
<xs:element name="no" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="village">
<xs:complexType>
<xs:sequence>
<xs:element name="st">
<xs:complexType>
<xs:sequence>
<xs:element name="no" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Another solution would be to define a complexType and reference that as
follows:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
<xs:complexType name="typeName">
<xs:sequence>
<xs:element name="st">
<xs:complexType>
<xs:sequence>
<xs:element name="no" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:element name="country">
<xs:complexType>
<xs:sequence>
<xs:element name="city" type="typeName"></xs:element>
<xs:element name="village" type="typeName"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Martin Honnen -- MVP XML
http://JavaScript.FAQTs.com/|||Thank You
"Martin Honnen" <mahotrash@.yahoo.de> wrote in message
news:%23fG8lyhwHHA.1212@.TK2MSFTNGP05.phx.gbl...
> Meenakshi wrote:
> Here is an example schema that inlines the element definitions:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
> <xs:element name="country">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="city">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="st">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="no" type="xs:int"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="village">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="st">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="no" type="xs:int"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
>
> Another solution would be to define a complexType and reference that as
> follows:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
> <xs:complexType name="typeName">
> <xs:sequence>
> <xs:element name="st">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="no" type="xs:int"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> <xs:element name="country">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="city" type="typeName"></xs:element>
> <xs:element name="village" type="typeName"></xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
> --
> Martin Honnen -- MVP XML
> http://JavaScript.FAQTs.com/

Can tags be duplicated?

My xml file has the tags in the below format.
say :
<country>
<city>
<st>
<no>5</no>
</st>
</city>
<village>
<st>
<no>4</no>
</st>
</village>
</country>
Can the tag <st> be present within 2 different parents?
If yes, how do I differentiate <st> in each case?
Regards
Meenakshi
Meenakshi wrote:

> Can the tag <st> be present within 2 different parents?
Yes, of course.

> If yes, how do I differentiate <st> in each case?
Do you want to write a schema for that XML? Or do you want to query the XML?
Martin Honnen -- MVP XML
http://JavaScript.FAQTs.com/
|||I need to write a scema for that XML.
How do I do that?
Regards
Meena
"Martin Honnen" <mahotrash@.yahoo.de> wrote in message
news:OM5sj5JwHHA.4528@.TK2MSFTNGP03.phx.gbl...
> Meenakshi wrote:
>
> Yes, of course.
>
> Do you want to write a schema for that XML? Or do you want to query the
> XML?
> --
> Martin Honnen -- MVP XML
> http://JavaScript.FAQTs.com/
|||Meenakshi wrote:
> I need to write a scema for that XML.
> How do I do that?
Here is an example schema that inlines the element definitions:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
<xs:element name="country">
<xs:complexType>
<xs:sequence>
<xs:element name="city">
<xs:complexType>
<xs:sequence>
<xs:element name="st">
<xs:complexType>
<xs:sequence>
<xs:element name="no" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="village">
<xs:complexType>
<xs:sequence>
<xs:element name="st">
<xs:complexType>
<xs:sequence>
<xs:element name="no" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Another solution would be to define a complexType and reference that as
follows:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
<xs:complexType name="typeName">
<xs:sequence>
<xs:element name="st">
<xs:complexType>
<xs:sequence>
<xs:element name="no" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:element name="country">
<xs:complexType>
<xs:sequence>
<xs:element name="city" type="typeName"></xs:element>
<xs:element name="village" type="typeName"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Martin Honnen -- MVP XML
http://JavaScript.FAQTs.com/
|||Thank You
"Martin Honnen" <mahotrash@.yahoo.de> wrote in message
news:%23fG8lyhwHHA.1212@.TK2MSFTNGP05.phx.gbl...
> Meenakshi wrote:
> Here is an example schema that inlines the element definitions:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
> <xs:element name="country">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="city">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="st">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="no" type="xs:int"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="village">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="st">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="no" type="xs:int"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
>
> Another solution would be to define a complexType and reference that as
> follows:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
> <xs:complexType name="typeName">
> <xs:sequence>
> <xs:element name="st">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="no" type="xs:int"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> <xs:element name="country">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="city" type="typeName"></xs:element>
> <xs:element name="village" type="typeName"></xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
> --
> Martin Honnen -- MVP XML
> http://JavaScript.FAQTs.com/

Sunday, February 19, 2012

can rs get xml data from a WCF netTcp endpoint

can rs get xml data from a netTcp, wsHttp, or netPipe binding? I assume it can get it from basicHttp bindings since theyre are ws1.1.

Thanks!

oh also, if your return type for an operation contract is System.Data.DataSet, do you need to create a datacontract for DataSet and how? or is it automatically serialized into soap like the .net 2.0 webservices do?

answered my own question, no, basichttp was the only thing i could get to work.

datasets will serialize automatically just as primitaves do.

Can ReportViewer save report to another format?

Now Report Viewer can save report to xml and pdf format.

Can it save report to another format? e.g word, text

This depends on availability of renderers.
Currently no, in future versions - yes, likely

|||

yes it's possible, however you have to write your own report renderer. Please read this link http://msdn.microsoft.com/msdnmag/issues/05/02/CustomRenderers/ for more info.

Tuesday, February 14, 2012

can openxml write multiple fields - 1 row?

I am starting to get the hang of this. The trick is in
the ConvertToXML UDF. Here is the xml string that I want
to create which will work with openxml
<ROOT><Worktable rownum="1" fName="Joe" lName="Smith"
DOB="1/1/01" Age="3"/></ROOT>
Here is the string that I pass in to the ConvertToXML UDF
'1,Joe,Smith,1/1/01,3'
Here is the Original function
CREATE FUNCTION dbo.ArrayToXML( @.InputStr varchar (8000),
@.Delim varchar (5))
returns varchar (8000)
as
begin
return ('<ROOT><Worktable Value="' + replace (@.InputStr,
@.Delim, '"/><Worktable Value="') + '"/></ROOT>')
end
which yields the following from '1,Joe,Smith,1/1/01,3'
<ROOT><Worktable Value="1"/><Worktable
Value="Joe"/><Worktable Value="Smith"/><Worktable
Value="1/1/01"/><Worktable Value="3"/></ROOT>
which is 5 rows and one column
But I need it to look like this:
<ROOT><Worktable rownum="1" fName="Joe" lName="Smith"
DOB="1/1/01" Age="3"/></ROOT>
to get 1 row and 5 columns
so in the function my kludge would look like this:
...
declare @.rownum int
declare @.fName varchar(10)
declare @.lName varchar(10)
declare @.dob datetime
declare @.age int
declare @.pos1 int
declare @.pos2 int
begin
--@.input = '1,Joe,Smith,1/1/01,3'
set @.rownum = Left(@.input, 1)
set @.pos1 = charindex(@.input, ',', 3) -- start after 1st
comma so @.pos1 is at 2nd comma
set @.fName = substring(@.input, 3, @.pos1 - 3)
set @.pos1 = @.pos1 + 1 --move 1 past 2nd comma
set @.pos2 = charindex(@.input, ',', @.pos1) --3rd comma
set @.lName = substring(@.input, @.pos1, @.pos2 - @.pos1)
set @.pos2 = @.pos2 + 1 --move 1 past 3rd comma
set @.pos1 = charindex(@.input, ',', @.pos2) --4th comma
set @.dob = substring(@.input, @.pos2, @.pos1 - @.pos2)
set @.age = substring(@.input, @.pos1, Len(@.input - @.pos1))
return '<ROOT><Worktable rownum="' + @.rownum + ' fName="'
+ @.fName + ' lName="' + @.lName + ' dob="' + @.dob + ' age="
+ @.age + '/><ROOT>
End
If anyone has a suggestion how I could streamline this -
please share because my actual row is more like 50
fields. I am thinking a loop would be more efficient, but
I don't know how to implement a loop in a Sql Server UDF.
Could someone share please?
Thanks,
Ed
set @.pos1 = charindex(@.input, ',', @.pos2) --
Hi Ed,
You might have a slightly easier time converting the input string to XML
using C#/VB (or some other mid-tier programming language). Also from a DB
performance standpoint offloading all this string manipulation elsewhere may
help (although the XML you send over the wire will be bigger) - of course
all this depends on how your app is set up and where your bottlenecks are,
so take this with a grain of salt
You can check out
http://msdn.microsoft.com/library/de...chtutorial.asp
for a good example of implementing a class that supports the foreach loop
construct over an array of string tokens. Combine that with your favorite
TextReader implementation to read through all the "rows" of string tokens to
generate your XML. In terms of generating the XML you can just use string
manipulation or the XmlWriter API
(http://msdn.microsoft.com/library/de...-us/cpref/html
/frlrfsystemxmlxmlwriterclasstopic.asp) - The XmlWriter API takes a little
getting used to but it gives you a higher level abstraction write access to
the underlying XML.
You could loop through your string tokens and create XML that looks like:
<Root value1='{somevalue}' value2='{someothervalue}...</Root> by appending
the iteration number to the name of the attribute value - if there is a
consistent ordering of fields in the file you could then just use the
"colPattern" construct in OPENXML to map the attributes to the appropriate
columns in the table.
If you need to do the whole thing in the server let me know and we can think
about further.
Thanks,
Adam Wiener [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.
"ED" <anonymous@.discussions.microsoft.com> wrote in message
news:0c9701c47b08$e66b4100$a601280a@.phx.gbl...
> I am starting to get the hang of this. The trick is in
> the ConvertToXML UDF. Here is the xml string that I want
> to create which will work with openxml
> <ROOT><Worktable rownum="1" fName="Joe" lName="Smith"
> DOB="1/1/01" Age="3"/></ROOT>
> Here is the string that I pass in to the ConvertToXML UDF
> '1,Joe,Smith,1/1/01,3'
> Here is the Original function
> ----
> CREATE FUNCTION dbo.ArrayToXML( @.InputStr varchar (8000),
> @.Delim varchar (5))
> returns varchar (8000)
> as
> begin
> return ('<ROOT><Worktable Value="' + replace (@.InputStr,
> @.Delim, '"/><Worktable Value="') + '"/></ROOT>')
> end
> which yields the following from '1,Joe,Smith,1/1/01,3'
> <ROOT><Worktable Value="1"/><Worktable
> Value="Joe"/><Worktable Value="Smith"/><Worktable
> Value="1/1/01"/><Worktable Value="3"/></ROOT>
> which is 5 rows and one column
> ----
> But I need it to look like this:
> <ROOT><Worktable rownum="1" fName="Joe" lName="Smith"
> DOB="1/1/01" Age="3"/></ROOT>
> to get 1 row and 5 columns
> so in the function my kludge would look like this:
> ...
> declare @.rownum int
> declare @.fName varchar(10)
> declare @.lName varchar(10)
> declare @.dob datetime
> declare @.age int
> declare @.pos1 int
> declare @.pos2 int
> begin
> --@.input = '1,Joe,Smith,1/1/01,3'
> set @.rownum = Left(@.input, 1)
> set @.pos1 = charindex(@.input, ',', 3) -- start after 1st
> comma so @.pos1 is at 2nd comma
> set @.fName = substring(@.input, 3, @.pos1 - 3)
> set @.pos1 = @.pos1 + 1 --move 1 past 2nd comma
> set @.pos2 = charindex(@.input, ',', @.pos1) --3rd comma
> set @.lName = substring(@.input, @.pos1, @.pos2 - @.pos1)
> set @.pos2 = @.pos2 + 1 --move 1 past 3rd comma
> set @.pos1 = charindex(@.input, ',', @.pos2) --4th comma
> set @.dob = substring(@.input, @.pos2, @.pos1 - @.pos2)
> set @.age = substring(@.input, @.pos1, Len(@.input - @.pos1))
> return '<ROOT><Worktable rownum="' + @.rownum + ' fName="'
> + @.fName + ' lName="' + @.lName + ' dob="' + @.dob + ' age="
> + @.age + '/><ROOT>
> End
> If anyone has a suggestion how I could streamline this -
> please share because my actual row is more like 50
> fields. I am thinking a loop would be more efficient, but
> I don't know how to implement a loop in a Sql Server UDF.
> Could someone share please?
> Thanks,
> Ed
> set @.pos1 = charindex(@.input, ',', @.pos2) --
>
>
|||Actually I was just looking around MSDN and if you can do it using C# then
you will have a much easier time with Chris Lovett's XmlCsvReader at
http://msdn.microsoft.com/library/de...lcsvreader.asp -
This will give you a much easier time - just put the column names you want
in the first row of your CSV file/stream and this thing will do the work for
you. The link has a code sample to get you going.
Thanks,
Adam Wiener [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.
"Adam Wiener [MSFT]" <adamw@.online.microsoft.com> wrote in message
news:ODVQrK7fEHA.636@.TK2MSFTNGP12.phx.gbl...
> Hi Ed,
> You might have a slightly easier time converting the input string to XML
> using C#/VB (or some other mid-tier programming language). Also from a DB
> performance standpoint offloading all this string manipulation elsewhere
may
> help (although the XML you send over the wire will be bigger) - of course
> all this depends on how your app is set up and where your bottlenecks are,
> so take this with a grain of salt
> You can check out
>
http://msdn.microsoft.com/library/de...chtutorial.asp
> for a good example of implementing a class that supports the foreach loop
> construct over an array of string tokens. Combine that with your favorite
> TextReader implementation to read through all the "rows" of string tokens
to
> generate your XML. In terms of generating the XML you can just use string
> manipulation or the XmlWriter API
>
(http://msdn.microsoft.com/library/de...-us/cpref/html
> /frlrfsystemxmlxmlwriterclasstopic.asp) - The XmlWriter API takes a little
> getting used to but it gives you a higher level abstraction write access
to
> the underlying XML.
> You could loop through your string tokens and create XML that looks like:
> <Root value1='{somevalue}' value2='{someothervalue}...</Root> by
appending
> the iteration number to the name of the attribute value - if there is a
> consistent ordering of fields in the file you could then just use the
> "colPattern" construct in OPENXML to map the attributes to the appropriate
> columns in the table.
> If you need to do the whole thing in the server let me know and we can
think
> about further.
> --
> Thanks,
> Adam Wiener [MSFT]
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> "ED" <anonymous@.discussions.microsoft.com> wrote in message
> news:0c9701c47b08$e66b4100$a601280a@.phx.gbl...
>
|||Depending on what you finally want to do with it, I am not sure that going
from CSV to XML to rowset is the best way.
At least in the context of SQL Server 2005, you probably want to write a CLR
user defined function that takes the CSV and makes it directly into a
table-valued result.
Otherwise, Adam's suggestions are useful too.
Best regards
Michael
"Adam Wiener [MSFT]" <adamw@.online.microsoft.com> wrote in message
news:uvUdwO7fEHA.536@.TK2MSFTNGP11.phx.gbl...
> Actually I was just looking around MSDN and if you can do it using C# then
> you will have a much easier time with Chris Lovett's XmlCsvReader at
> http://msdn.microsoft.com/library/de...lcsvreader.asp -
> This will give you a much easier time - just put the column names you want
> in the first row of your CSV file/stream and this thing will do the work
> for
> you. The link has a code sample to get you going.
> --
> Thanks,
> Adam Wiener [MSFT]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> "Adam Wiener [MSFT]" <adamw@.online.microsoft.com> wrote in message
> news:ODVQrK7fEHA.636@.TK2MSFTNGP12.phx.gbl...
> may
> http://msdn.microsoft.com/library/de...chtutorial.asp
> to
> (http://msdn.microsoft.com/library/de...-us/cpref/html
> to
> appending
> think
> rights.
>

Friday, February 10, 2012

Can not load file into Database Help!

I tried to load a file (Data.xml) into SQLServer 2000 using Schema.xml file
but when i load the file i check the table and nothing was loaded, and i
don't get any error in error.log file
A
I create a file called load.vbs
set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkload")
objBL.ConnectionString = "provider=SQLOLEDB.1;data
source=localhost;database=miDatabase;uid=sa;pwd=;"
objBL.ErrorLogFile = "C:\error.log"
objBL.Execute "C:\Schema.xml", "C:\Data.xml"
set objBL=Nothing
And schema called Schema.xml
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
<xsd:element name="Registro" sql:relation="Sufisinterno" >
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Tipo" type="xsd:string" />
<xsd:element name="Identificacion" type="xsd:string" />
<xsd:element name="PrimerApellido" type="xsd:string" />
<xsd:element name="SegundoApellido" type="xsd:string" />
<xsd:element name="Nombre" type="xsd:string" />
<xsd:element name="Genero" type="xsd:string" />
<xsd:element name="PaisNacimiento" type="xsd:string" />
<xsd:element name="tmpFechaNaci" type="xsd:string" />
<xsd:element name="IdentificacionTitular" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
And a file called data.xml
<?xml version="1.0" encoding="utf-8"?><PadronInternoPersonasFisicas
xmlns="http://www.sugef.fi.cr/esquemas/SUGEF-PadronInternoPersonasFisicas.xsd"><Registro><Tipo> 1</Tipo><Identificacion>0031977420010001709</Identificacion><PrimerApellido>FRESNEDA</PrimerApellido><SegundoApellido>MORENO</SegundoApellido><Nombre>HAROLD
AMED</Nombre><Genero>1</Genero><FechaNacimiento>13/09/1978</FechaNacimiento><PaisNacimiento>CO</PaisNacimiento><IdentificacionTitular>003197742001 0001709</IdentificacionTitular></Registro><Registro><Tipo>1</Tipo><Identificacion>003860579</Identificacion><PrimerApellido>GONZALEZ</PrimerApellido><SegundoApellido>NIETO</SegundoApellido><Nombre>MARIA
DEL
CARMEN</Nombre><Genero>2</Genero><FechaNacimiento>15/10/1965</FechaNacimiento><PaisNacimiento>CU</PaisNacimiento><IdentificacionTitular>C386579</IdentificacionTitular></Registro><Registro><Tipo>1</Tipo><Identificacion>013478458</Identificacion><PrimerApellido>FIGUEROA</PrimerApellido><SegundoApellido>VANEGAS</SegundoApellido><Nombre>JOSE
RAUL</Nombre><Genero>1</Genero><FechaNacimiento /><PaisNacimiento
/><IdentificacionTitular>013478458</IdentificacionTitular></Registro><Registro><Tipo>1</Tipo><Identificacion>038041262</Identificacion><PrimerApellido>SALAZAR</PrimerApellido><SegundoApellido
/><Nombre>BLANCA
ESTELLA</Nombre><Genero>2</Genero><FechaNacimiento>26/03/2007</FechaNacimiento><PaisNacimiento>US</PaisNacimiento><IdentificacionTitular>038041262</IdentificacionTitular></Registro><Registro><Tipo>1</Tipo><Identificacion>043851379</Identificacion><PrimerApellido>SOTO</PrimerApellido><SegundoApellido>CALDERON</SegundoApellido><Nombre>MARIO
ALBERTO</Nombre><Genero>1</Genero><FechaNacimiento>22/01/1982</FechaNacimiento><PaisNacimiento>CR</PaisNacimiento><IdentificacionTitular>043851379</IdentificacionTitular></Registro><Registro><Tipo>1</Tipo><Identificacion>046164814</Identificacion><PrimerApellido>CROSSTY</PrimerApellido><SegundoApellido
/><Nombre>KEITH
ANTONIO</Nombre><Genero>1</Genero><FechaNacimiento>18/02/1957</FechaNacimiento><PaisNacimiento
/><IdentificacionTitular>046164814</IdentificacionTitular></Registro><Registro><Tipo>1</Tipo><Identificacion>046214376</Identificacion><PrimerApellido>GONZALEZ</PrimerApellido><SegundoApellido
/><Nombre>ENRIQUE</Nombre><Genero>1</Genero><FechaNacimiento>27/02/1937</FechaNacimiento><PaisNacimiento
/><IdentificacionTitular>046214376</IdentificacionTitular></Registro><Registro><Tipo>1</Tipo><Identificacion>064RE001076001999</Identificacion><PrimerApellido>MONTENEGRO</PrimerApellido><SegundoApellido>SANCHEZ</SegundoApellido><Nombre>LIDIA</Nombre><Genero>2</Genero><FechaNacimiento>28/10/1967</FechaNacimiento><PaisNacimiento
/><IdentificacionTitular>064RE001076001999</IdentificacionTitular></Registro></PadronInternoPersonasFisicas>
Hello junior,
I'm pretty sure its because you've got the namespace in your data XML file.
This means that the parsing needs to understand that namespace.
Not sure how you get it to understand it. I'll try a bit of digging
Simon Sabin
SQL Server MVP
http://sqlblogcasts.com/blogs/simons

> I tried to load a file (Data.xml) into SQLServer 2000 using Schema.xml
> file but when i load the file i check the table and nothing was
> loaded, and i don't get any error in error.log file
> A
> I create a file called load.vbs
> set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkload")
> objBL.ConnectionString = "provider=SQLOLEDB.1;data
> source=localhost;database=miDatabase;uid=sa;pwd=;"
> objBL.ErrorLogFile = "C:\error.log"
> objBL.Execute "C:\Schema.xml", "C:\Data.xml"
> set objBL=Nothing
> And schema called Schema.xml
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
> <xsd:element name="Registro" sql:relation="Sufisinterno" >
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="Tipo" type="xsd:string" />
> <xsd:element name="Identificacion" type="xsd:string" />
> <xsd:element name="PrimerApellido" type="xsd:string" />
> <xsd:element name="SegundoApellido" type="xsd:string" />
> <xsd:element name="Nombre" type="xsd:string" />
> <xsd:element name="Genero" type="xsd:string" />
> <xsd:element name="PaisNacimiento" type="xsd:string" />
> <xsd:element name="tmpFechaNaci" type="xsd:string" />
> <xsd:element name="IdentificacionTitular" type="xsd:string" />
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> </xsd:schema>
> And a file called data.xml
> <?xml version="1.0" encoding="utf-8"?><PadronInternoPersonasFisicas
> xmlns="http://www.sugef.fi.cr/esquemas/SUGEF-PadronInternoPersonasFisi
> cas.xsd"><Registro><Tipo>1</Tipo><Identificacion>0031977420010001709</
> Identificacion><PrimerApellido>FRESNEDA</PrimerApellido><SegundoApelli
> do>MORENO</SegundoApellido><Nombre>HAROLD
> AMED</Nombre><Genero>1</Genero><FechaNacimiento>13/09/1978</FechaNacim
> iento><PaisNacimiento>CO</PaisNacimiento><IdentificacionTitular>003197
> 7420010001709</IdentificacionTitular></Registro><Registro><Tipo>1</Tip
> o><Identificacion>003860579</Identificacion><PrimerApellido>GONZALEZ</
> PrimerApellido><SegundoApellido>NIETO</SegundoApellido><Nombre>MARIA
> DEL
> CARMEN</Nombre><Genero>2</Genero><FechaNacimiento>15/10/1965</FechaNac
> imiento><PaisNacimiento>CU</PaisNacimiento><IdentificacionTitular>C386
> 579</IdentificacionTitular></Registro><Registro><Tipo>1</Tipo><Identif
> icacion>013478458</Identificacion><PrimerApellido>FIGUEROA</PrimerApel
> lido><SegundoApellido>VANEGAS</SegundoApellido><Nombre>JOSE
> RAUL</Nombre><Genero>1</Genero><FechaNacimiento /><PaisNacimiento
> /><IdentificacionTitular>013478458</IdentificacionTitular></Registro><
> Registro><Tipo>1</Tipo><Identificacion>038041262</Identificacion><Prim
> erApellido>SALAZAR</PrimerApellido><SegundoApellido /><Nombre>BLANCA
> ESTELLA</Nombre><Genero>2</Genero><FechaNacimiento>26/03/2007</FechaNa
> cimiento><PaisNacimiento>US</PaisNacimiento><IdentificacionTitular>038
> 041262</IdentificacionTitular></Registro><Registro><Tipo>1</Tipo><Iden
> tificacion>043851379</Identificacion><PrimerApellido>SOTO</PrimerApell
> ido><SegundoApellido>CALDERON</SegundoApellido><Nombre>MARIO
> ALBERTO</Nombre><Genero>1</Genero><FechaNacimiento>22/01/1982</FechaNa
> cimiento><PaisNacimiento>CR</PaisNacimiento><IdentificacionTitular>043
> 851379</IdentificacionTitular></Registro><Registro><Tipo>1</Tipo><Iden
> tificacion>046164814</Identificacion><PrimerApellido>CROSSTY</PrimerAp
> ellido><SegundoApellido /><Nombre>KEITH
> ANTONIO</Nombre><Genero>1</Genero><FechaNacimiento>18/02/1957</FechaNa
> cimiento><PaisNacimiento
> /><IdentificacionTitular>046164814</IdentificacionTitular></Registro><
> Registro><Tipo>1</Tipo><Identificacion>046214376</Identificacion><Prim
> erApellido>GONZALEZ</PrimerApellido><SegundoApellido
> /><Nombre>ENRIQUE</Nombre><Genero>1</Genero><FechaNacimiento>27/02/193
> 7</FechaNacimiento><PaisNacimiento
> /><IdentificacionTitular>046214376</IdentificacionTitular></Registro><
> Registro><Tipo>1</Tipo><Identificacion>064RE001076001999</Identificaci
> on><PrimerApellido>MONTENEGRO</PrimerApellido><SegundoApellido>SANCHEZ
> </SegundoApellido><Nombre>LIDIA</Nombre><Genero>2</Genero><FechaNacimi
> ento>28/10/1967</FechaNacimiento><PaisNacimiento
> /><IdentificacionTitular>064RE001076001999</IdentificacionTitular></Re
> gistro></PadronInternoPersonasFisicas>
>
|||Yes you are right if i delete the namespace
xmlns="http://www.sugef.fi.cr/esquemas/SUGEF-PadronInternoPersonasFisicas.xsd"
i can load the file, but file is about 1 Gb size and i want to avoid open
the file for delete the namespace.
Any help would be very helpful.
Thank you.
"Simon Sabin" wrote:

> Hello junior,
> I'm pretty sure its because you've got the namespace in your data XML file.
> This means that the parsing needs to understand that namespace.
> Not sure how you get it to understand it. I'll try a bit of digging
>
> Simon Sabin
> SQL Server MVP
> http://sqlblogcasts.com/blogs/simons
>
>
>

Can not load file into Database Help!

I tried to load a file (Data.xml) into SQLServer 2000 using Schema.xml file
but when i load the file i check the table and nothing was loaded, and i
don't get any error in error.log file
A
I create a file called load.vbs
set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkload")
objBL.ConnectionString = "provider=SQLOLEDB.1;data
source=localhost;database=miDatabase;uid
=sa;pwd=;"
objBL.ErrorLogFile = "C:\error.log"
objBL.Execute "C:\Schema.xml", "C:\Data.xml"
set objBL=Nothing
And schema called Schema.xml
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
<xsd:element name="Registro" sql:relation="Sufisinterno" >
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Tipo" type="xsd:string" />
<xsd:element name="Identificacion" type="xsd:string" />
<xsd:element name="PrimerApellido" type="xsd:string" />
<xsd:element name="SegundoApellido" type="xsd:string" />
<xsd:element name="Nombre" type="xsd:string" />
<xsd:element name="Genero" type="xsd:string" />
<xsd:element name="PaisNacimiento" type="xsd:string" />
<xsd:element name="tmpFechaNaci" type="xsd:string" />
<xsd:element name="IdentificacionTitular" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
And a file called data.xml
<?xml version="1.0" encoding="utf-8"?><PadronInternoPersonasFisicas
xmlns="http://www.sugef.fi.cr/esquemas/SUGEF-PadronInternoPersonasFisicas.xs
d"><Registro><Tipo>1</Tipo><Identificacion>0031977420010001709</Identificaci
on><PrimerApellido>FRESNEDA</PrimerApellido><SegundoApellido>MORENO</Segundo
Apellido><Nombre>HAROLD
AMED</Nombre><Genero>1</Genero><FechaNacimiento>13/09/1978</FechaNacimiento>
<PaisNacimiento>CO</PaisNacimiento><IdentificacionTitular>003197742001000170
9</IdentificacionTitular></Registro><Registro><Tipo>1</Tipo><Identificacion>
003860579</Identificacion><
PrimerApellido>GONZALEZ</PrimerApellido><SegundoApellido>NIETO</SegundoApell
ido><Nombre>MARIA
DEL
CARMEN</Nombre><Genero>2</Genero><FechaNacimiento>15/10/1965</FechaNacimient
o><PaisNacimiento>CU</PaisNacimiento><IdentificacionTitular>C386579</Identif
icacionTitular></Registro><Registro><Tipo>1</Tipo><Identificacion>013478458<
/Identificacion><PrimerApel
lido>FIGUEROA</PrimerApellido><SegundoApellido>VANEGAS</SegundoApellido><Nom
bre>JOSE
RAUL</Nombre><Genero>1</Genero><FechaNacimiento /><PaisNacimiento
/><IdentificacionTitular>013478458</IdentificacionTitular></Registro><Regist
ro><Tipo>1</Tipo><Identificacion>038041262</Identificacion><PrimerApellido>S
ALAZAR</PrimerApellido><SegundoApellido
/><Nombre>BLANCA
ESTELLA</Nombre><Genero>2</Genero><FechaNacimiento>26/03/2007</FechaNacimien
to><PaisNacimiento>US</PaisNacimiento><IdentificacionTitular>038041262</Iden
tificacionTitular></Registro><Registro><Tipo>1</Tipo><Identificacion>0438513
79</Identificacion><PrimerA
pellido>SOTO</PrimerApellido><SegundoApellido>CALDERON</SegundoApellido><Nom
bre>MARIO
ALBERTO</Nombre><Genero>1</Genero><FechaNacimiento>22/01/1982</FechaNacimien
to><PaisNacimiento>CR</PaisNacimiento><IdentificacionTitular>043851379</Iden
tificacionTitular></Registro><Registro><Tipo>1</Tipo><Identificacion>0461648
14</Identificacion><PrimerA
pellido>CROSSTY</PrimerApellido><SegundoApellido
/><Nombre>KEITH
ANTONIO</Nombre><Genero>1</Genero><FechaNacimiento>18/02/1957</FechaNacimien
to><PaisNacimiento
/><IdentificacionTitular>046164814</IdentificacionTitular></Registro><Regist
ro><Tipo>1</Tipo><Identificacion>046214376</Identificacion><PrimerApellido>G
ONZALEZ</PrimerApellido><SegundoApellido
/><Nombre>ENRIQUE</Nombre><Genero>1</Genero><FechaNacimiento>27/02/1937</Fec
haNacimiento><PaisNacimiento
/><IdentificacionTitular>046214376</IdentificacionTitular></Registro><Regist
ro><Tipo>1</Tipo><Identificacion>064RE001076001999</Identificacion><PrimerAp
ellido>MONTENEGRO</PrimerApellido><SegundoApellido>SANCHEZ</SegundoApellido>
<Nombre>LIDIA</Nombre><Gene
ro>2</Genero><FechaNacimiento>28/10/1967</FechaNacimiento><PaisNacimiento
/><IdentificacionTitular>064RE001076001999</IdentificacionTitular></Registro
></PadronInternoPersonasFisicas>Hello junior,
I'm pretty sure its because you've got the namespace in your data XML file.
This means that the parsing needs to understand that namespace.
Not sure how you get it to understand it. I'll try a bit of digging
Simon Sabin
SQL Server MVP
http://sqlblogcasts.com/blogs/simons

> I tried to load a file (Data.xml) into SQLServer 2000 using Schema.xml
> file but when i load the file i check the table and nothing was
> loaded, and i don't get any error in error.log file
> A
> I create a file called load.vbs
> set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkload")
> objBL.ConnectionString = "provider=SQLOLEDB.1;data
> source=localhost;database=miDatabase;uid
=sa;pwd=;"
> objBL.ErrorLogFile = "C:\error.log"
> objBL.Execute "C:\Schema.xml", "C:\Data.xml"
> set objBL=Nothing
> And schema called Schema.xml
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
> <xsd:element name="Registro" sql:relation="Sufisinterno" >
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="Tipo" type="xsd:string" />
> <xsd:element name="Identificacion" type="xsd:string" />
> <xsd:element name="PrimerApellido" type="xsd:string" />
> <xsd:element name="SegundoApellido" type="xsd:string" />
> <xsd:element name="Nombre" type="xsd:string" />
> <xsd:element name="Genero" type="xsd:string" />
> <xsd:element name="PaisNacimiento" type="xsd:string" />
> <xsd:element name="tmpFechaNaci" type="xsd:string" />
> <xsd:element name="IdentificacionTitular" type="xsd:string" />
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> </xsd:schema>
> And a file called data.xml
> <?xml version="1.0" encoding="utf-8"?><PadronInternoPersonasFisicas
> xmlns="http://www.sugef.fi.cr/esquemas/SUGEF-PadronInternoPersonasFisi
> cas.xsd"><Registro><Tipo>1</Tipo><Identificacion>0031977420010001709</
> Identificacion><PrimerApellido>FRESNEDA</PrimerApellido><SegundoApelli
> do>MORENO</SegundoApellido><Nombre>HAROLD
> AMED</Nombre><Genero>1</Genero><FechaNacimiento>13/09/1978</FechaNacim
> iento><PaisNacimiento>CO</PaisNacimiento><IdentificacionTitular>003197
> 7420010001709</IdentificacionTitular></Registro><Registro><Tipo>1</Tip
> o><Identificacion>003860579</Identificacion><PrimerApellido>GONZALEZ</
> PrimerApellido><SegundoApellido>NIETO</SegundoApellido><Nombre>MARIA
> DEL
> CARMEN</Nombre><Genero>2</Genero><FechaNacimiento>15/10/1965</FechaNac
> imiento><PaisNacimiento>CU</PaisNacimiento><IdentificacionTitular>C386
> 579</IdentificacionTitular></Registro><Registro><Tipo>1</Tipo><Identif
> icacion>013478458</Identificacion><PrimerApellido>FIGUEROA</PrimerApel
> lido><SegundoApellido>VANEGAS</SegundoApellido><Nombre>JOSE
> RAUL</Nombre><Genero>1</Genero><FechaNacimiento /><PaisNacimiento
> /><IdentificacionTitular>013478458</IdentificacionTitular></Registro><
> Registro><Tipo>1</Tipo><Identificacion>038041262</Identificacion><Prim
> erApellido>SALAZAR</PrimerApellido><SegundoApellido /><Nombre>BLANCA
> ESTELLA</Nombre><Genero>2</Genero><FechaNacimiento>26/03/2007</FechaNa
> cimiento><PaisNacimiento>US</PaisNacimiento><IdentificacionTitular>038
> 041262</IdentificacionTitular></Registro><Registro><Tipo>1</Tipo><Iden
> tificacion>043851379</Identificacion><PrimerApellido>SOTO</PrimerApell
> ido><SegundoApellido>CALDERON</SegundoApellido><Nombre>MARIO
> ALBERTO</Nombre><Genero>1</Genero><FechaNacimiento>22/01/1982</FechaNa
> cimiento><PaisNacimiento>CR</PaisNacimiento><IdentificacionTitular>043
> 851379</IdentificacionTitular></Registro><Registro><Tipo>1</Tipo><Iden
> tificacion>046164814</Identificacion><PrimerApellido>CROSSTY</PrimerAp
> ellido><SegundoApellido /><Nombre>KEITH
> ANTONIO</Nombre><Genero>1</Genero><FechaNacimiento>18/02/1957</FechaNa
> cimiento><PaisNacimiento
> /><IdentificacionTitular>046164814</IdentificacionTitular></Registro><
> Registro><Tipo>1</Tipo><Identificacion>046214376</Identificacion><Prim
> erApellido>GONZALEZ</PrimerApellido><SegundoApellido
> /><Nombre>ENRIQUE</Nombre><Genero>1</Genero><FechaNacimiento>27/02/193
> 7</FechaNacimiento><PaisNacimiento
> /><IdentificacionTitular>046214376</IdentificacionTitular></Registro><
> Registro><Tipo>1</Tipo><Identificacion>064RE001076001999</Identificaci
> on><PrimerApellido>MONTENEGRO</PrimerApellido><SegundoApellido>SANCHEZ
> </SegundoApellido><Nombre>LIDIA</Nombre><Genero>2</Genero><FechaNacimi
> ento>28/10/1967</FechaNacimiento><PaisNacimiento
> /><IdentificacionTitular>064RE001076001999</IdentificacionTitular></Re
> gistro></PadronInternoPersonasFisicas>
>|||Yes you are right if i delete the namespace
xmlns="http://www.sugef.fi.cr/esquemas/SUGEF-PadronInternoPersonasFisicas.xs
d"
i can load the file, but file is about 1 Gb size and i want to avoid open
the file for delete the namespace.
Any help would be very helpful.
Thank you.
"Simon Sabin" wrote:

> Hello junior,
> I'm pretty sure its because you've got the namespace in your data XML file
.
> This means that the parsing needs to understand that namespace.
> Not sure how you get it to understand it. I'll try a bit of digging
>
> Simon Sabin
> SQL Server MVP
> http://sqlblogcasts.com/blogs/simons
>
>
>