dbTalk Databases Forums  

Simple export from db1 import to db2 using xml problem

microsoft.public.sqlserver.xml microsoft.public.sqlserver.xml


Discuss Simple export from db1 import to db2 using xml problem in the microsoft.public.sqlserver.xml forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
EPK
 
Posts: n/a

Default Simple export from db1 import to db2 using xml problem - 05-14-2007 , 01:48 PM






I thought this should be simple but it does not seem to work. I was
trying to use FOR XML to generate XML data and XSD and
SQLXMLBULKLOADLib to import the data. In actual implementation the
data will be generated on one SQL server instance and then imported -
creating a new table on another. For test purposes I was extracting
data from an existing table, modifying it and then trying to import it
back to the same table. However, the XSD I get from:

SELECT USERID + '99' AS USERID, UserGrp AS UserGrp, BOS AS BOS,
MultiBOS AS MultiBOS, BOSacct AS BOSacct,
COAVisibility as COAVisibility, Organization AS Organization, Office
AS Office, Location AS Location, Title AS Title,
LName AS LName, FName AS FName, Phone AS Phone, EMAIL AS EMAIL, Remark
AS Remark, ActiveUser AS ActiveUser,
UserType AS UserType, WinUserID AS WinUserID, RptVisibility AS
RptVisibility, OPAGY AS OPAGY, OPAGYacct AS OPAGYacct,
Valid_Sponsor AS Valid_Sponsor, CONVERT(CHAR(10),Valid_date,101) AS
Valid_date, History, DASC_Group, DASC_Level
FROM tblUsers WHERE USERID LIKE 'zzz%' FOR XML AUTO, XMLSCHEMA

This does not Give me errors when I try to import the data back to the
table using SQLXMLBULKLOADLib, it just doesn't create any new data.

Shouldn't this work?


Reply With Quote
  #2  
Old   
Michael Rys [MSFT]
 
Posts: n/a

Default Re: Simple export from db1 import to db2 using xml problem - 05-14-2007 , 03:00 PM






Note that the XSD generated by FOR XML does not create the annotations to
perform the mapping. It only creates a validating schema.

You would have to provide the mapping in the XSD afterwards.

If you find this an important or useful feature to add, I encourage you to
use our feedback site at http://connect.microsoft.com/sqlserver

Best regards
Michael

"EPK" <eileen.kelly (AT) ngc (DOT) com> wrote

Quote:
I thought this should be simple but it does not seem to work. I was
trying to use FOR XML to generate XML data and XSD and
SQLXMLBULKLOADLib to import the data. In actual implementation the
data will be generated on one SQL server instance and then imported -
creating a new table on another. For test purposes I was extracting
data from an existing table, modifying it and then trying to import it
back to the same table. However, the XSD I get from:

SELECT USERID + '99' AS USERID, UserGrp AS UserGrp, BOS AS BOS,
MultiBOS AS MultiBOS, BOSacct AS BOSacct,
COAVisibility as COAVisibility, Organization AS Organization, Office
AS Office, Location AS Location, Title AS Title,
LName AS LName, FName AS FName, Phone AS Phone, EMAIL AS EMAIL, Remark
AS Remark, ActiveUser AS ActiveUser,
UserType AS UserType, WinUserID AS WinUserID, RptVisibility AS
RptVisibility, OPAGY AS OPAGY, OPAGYacct AS OPAGYacct,
Valid_Sponsor AS Valid_Sponsor, CONVERT(CHAR(10),Valid_date,101) AS
Valid_date, History, DASC_Group, DASC_Level
FROM tblUsers WHERE USERID LIKE 'zzz%' FOR XML AUTO, XMLSCHEMA

This does not Give me errors when I try to import the data back to the
table using SQLXMLBULKLOADLib, it just doesn't create any new data.

Shouldn't this work?




Reply With Quote
  #3  
Old   
EPK
 
Posts: n/a

Default Re: Simple export from db1 import to db2 using xml problem - 05-15-2007 , 09:18 AM



On May 14, 4:00 pm, "Michael Rys [MSFT]" <m... (AT) online (DOT) microsoft.com>
wrote:
Quote:
Note that the XSD generated by FOR XML does not create the annotations to
perform the mapping. It only creates a validating schema.

You would have to provide the mapping in the XSD afterwards.

If you find this an important or useful feature to add, I encourage you to
use our feedback site athttp://connect.microsoft.com/sqlserver

Best regards
Michael

"EPK" <eileen.ke... (AT) ngc (DOT) com> wrote in message

news:1179168482.182550.298860 (AT) u30g2000hsc (DOT) googlegroups.com...



I thought this should be simple but it does not seem to work. I was
trying to use FOR XML to generate XML data and XSD and
SQLXMLBULKLOADLib to import the data. In actual implementation the
data will be generated on one SQL server instance and then imported -
creating a new table on another. For test purposes I was extracting
data from an existing table, modifying it and then trying to import it
back to the same table. However, the XSD I get from:

SELECT USERID + '99' AS USERID, UserGrp AS UserGrp, BOS AS BOS,
MultiBOS AS MultiBOS, BOSacct AS BOSacct,
COAVisibility as COAVisibility, Organization AS Organization, Office
AS Office, Location AS Location, Title AS Title,
LName AS LName, FName AS FName, Phone AS Phone, EMAIL AS EMAIL, Remark
AS Remark, ActiveUser AS ActiveUser,
UserType AS UserType, WinUserID AS WinUserID, RptVisibility AS
RptVisibility, OPAGY AS OPAGY, OPAGYacct AS OPAGYacct,
Valid_Sponsor AS Valid_Sponsor, CONVERT(CHAR(10),Valid_date,101) AS
Valid_date, History, DASC_Group, DASC_Level
FROM tblUsers WHERE USERID LIKE 'zzz%' FOR XML AUTO, XMLSCHEMA

This does not Give me errors when I try to import the data back to the
table using SQLXMLBULKLOADLib, it just doesn't create any new data.

Shouldn't this work?- Hide quoted text -

- Show quoted text -
Mapping? I'm not following you here I thought the mapping was
<xsd:element name="USERID"> part of the statement. What else do I
need? Do I have to create it manually? (SQL Server won't do it for
me? )



Reply With Quote
  #4  
Old   
Michael Rys [MSFT]
 
Posts: n/a

Default Re: Simple export from db1 import to db2 using xml problem - 05-20-2007 , 03:54 PM



FOR XML only creates the XML Schema for the data it returns. It does not
provide you with a schema that can be used to map the data back against the
database. If you want to use the SQLXML Bulkload functionality, you need to
provide mapping annotations to the XML Schema. And yes, FOR XML currently
does not create them automatically.

Best regards
Michael

PS: I recommend to look at the relevant annotated XSD schema chapter in BOL
(e.g.,
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/sqlxml49/html/eecd0d5f-d3dd-4d20-9586-19820410ad47.htm)

"EPK" <eileen.kelly (AT) ngc (DOT) com> wrote

Quote:
On May 14, 4:00 pm, "Michael Rys [MSFT]" <m... (AT) online (DOT) microsoft.com
wrote:
Note that the XSD generated by FOR XML does not create the annotations to
perform the mapping. It only creates a validating schema.

You would have to provide the mapping in the XSD afterwards.

If you find this an important or useful feature to add, I encourage you
to
use our feedback site athttp://connect.microsoft.com/sqlserver

Best regards
Michael

"EPK" <eileen.ke... (AT) ngc (DOT) com> wrote in message

news:1179168482.182550.298860 (AT) u30g2000hsc (DOT) googlegroups.com...



I thought this should be simple but it does not seem to work. I was
trying to use FOR XML to generate XML data and XSD and
SQLXMLBULKLOADLib to import the data. In actual implementation the
data will be generated on one SQL server instance and then imported -
creating a new table on another. For test purposes I was extracting
data from an existing table, modifying it and then trying to import it
back to the same table. However, the XSD I get from:

SELECT USERID + '99' AS USERID, UserGrp AS UserGrp, BOS AS BOS,
MultiBOS AS MultiBOS, BOSacct AS BOSacct,
COAVisibility as COAVisibility, Organization AS Organization, Office
AS Office, Location AS Location, Title AS Title,
LName AS LName, FName AS FName, Phone AS Phone, EMAIL AS EMAIL, Remark
AS Remark, ActiveUser AS ActiveUser,
UserType AS UserType, WinUserID AS WinUserID, RptVisibility AS
RptVisibility, OPAGY AS OPAGY, OPAGYacct AS OPAGYacct,
Valid_Sponsor AS Valid_Sponsor, CONVERT(CHAR(10),Valid_date,101) AS
Valid_date, History, DASC_Group, DASC_Level
FROM tblUsers WHERE USERID LIKE 'zzz%' FOR XML AUTO, XMLSCHEMA

This does not Give me errors when I try to import the data back to the
table using SQLXMLBULKLOADLib, it just doesn't create any new data.

Shouldn't this work?- Hide quoted text -

- Show quoted text -

Mapping? I'm not following you here I thought the mapping was
xsd:element name="USERID"> part of the statement. What else do I
need? Do I have to create it manually? (SQL Server won't do it for
me? )




Reply With Quote
  #5  
Old   
Aaron Dicks
 
Posts: n/a

Default XML Schema (XSD) from SQL Server - 09-01-2010 , 06:20 AM



I've found a similar problem, The guys at http://blog.liquid-technologies.com/ helped me out though, just ask a question on their blog. Theres a post about Importing too.

Quote:
On Monday, May 14, 2007 2:48 PM EPK wrote:

I thought this should be simple but it does not seem to work. I was
trying to use FOR XML to generate XML data and XSD and
SQLXMLBULKLOADLib to import the data. In actual implementation the
data will be generated on one SQL server instance and then imported -
creating a new table on another. For test purposes I was extracting
data from an existing table, modifying it and then trying to import it
back to the same table. However, the XSD I get from:

SELECT USERID + '99' AS USERID, UserGrp AS UserGrp, BOS AS BOS,
MultiBOS AS MultiBOS, BOSacct AS BOSacct,
COAVisibility as COAVisibility, Organization AS Organization, Office
AS Office, Location AS Location, Title AS Title,
LName AS LName, FName AS FName, Phone AS Phone, EMAIL AS EMAIL, Remark
AS Remark, ActiveUser AS ActiveUser,
UserType AS UserType, WinUserID AS WinUserID, RptVisibility AS
RptVisibility, OPAGY AS OPAGY, OPAGYacct AS OPAGYacct,
Valid_Sponsor AS Valid_Sponsor, CONVERT(CHAR(10),Valid_date,101) AS
Valid_date, History, DASC_Group, DASC_Level
FROM tblUsers WHERE USERID LIKE 'zzz%' FOR XML AUTO, XMLSCHEMA

This does not Give me errors when I try to import the data back to the
table using SQLXMLBULKLOADLib, it just doesn't create any new data.

Shouldn't this work?

Quote:
On Monday, May 14, 2007 4:00 PM Michael Rys [MSFT] wrote:

Note that the XSD generated by FOR XML does not create the annotations to
perform the mapping. It only creates a validating schema.

You would have to provide the mapping in the XSD afterwards.

If you find this an important or useful feature to add, I encourage you to
use our feedback site at http://connect.microsoft.com/sqlserver

Best regards
Michael

"EPK" <eileen.kelly (AT) ngc (DOT) com> wrote in message
news:1179168482.182550.298860 (AT) u30g2000hsc (DOT) googlegroups.com...

Quote:
On Tuesday, May 15, 2007 10:18 AM EPK wrote:

On May 14, 4:00 pm, "Michael Rys [MSFT]" <m... (AT) online (DOT) microsoft.com
wrote:

Mapping? I'm not following you here I thought the mapping was
xsd:element name="USERID"> part of the statement. What else do I
need? Do I have to create it manually? (SQL Server won't do it for
me? )

Quote:
On Sunday, May 20, 2007 4:54 PM Michael Rys [MSFT] wrote:

FOR XML only creates the XML Schema for the data it returns. It does not
provide you with a schema that can be used to map the data back against the
database. If you want to use the SQLXML Bulkload functionality, you need to
provide mapping annotations to the XML Schema. And yes, FOR XML currently
does not create them automatically.

Best regards
Michael

PS: I recommend to look at the relevant annotated XSD schema chapter in BOL
(e.g.,
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/sqlxml49/html/eecd0d5f-d3dd-4d20-9586-19820410ad47.htm)

"EPK" <eileen.kelly (AT) ngc (DOT) com> wrote in message
news:1179238693.322648.96490 (AT) o5g2000hsb (DOT) googlegroups.com...

Quote:
Submitted via EggHeadCafe - Software Developer Portal of Choice
MongoDb vs SQL Server Basic Speed Tests
http://www.eggheadcafe.com/tutorials...eed-tests.aspx

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.