Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

import danych z xml do ms sql

 
   Database Forums (Home) -> XML RSS
Next:  High Compilations counter but few cache insert ev..  
Author Message
walczyk

External


Since: Aug 05, 2005
Posts: 2



(Msg. 1) Posted: Fri Aug 05, 2005 1:59 pm
Post subject: import danych z xml do ms sql
Archived from groups: microsoft>public>sqlserver>xml (more info?)

Mam takie zapytanie bo mniej wiecej wiem jak odczytac plik taki xml i
wrzucic go do sql. Ja probowalem za pomoca OpenXml:
np.
DECLARE @hdoc int
DECLARE @doc varchar(8000)
SET @doc ='
<ROOT>
<Customer CustomerID="VINET" ContactName="Paul Henriot">
<Order CustomerID="VINET" EmployeeID="5"
OrderDate="1996-07-04T00:00:00">
<OrderDetail OrderID="10248" ProductID="11" Quantity="12"/>
</Order>
</Customer>
</ROOT>'
EXEC sp_xml_preparedocument @hdoc OUTPUT, @doc
exec sp_xml_removedocument @hdoc

Oczywiscie wszystko dziala bez zarzutu.
Ale ja mam inny problem bo dokument xml tutaj moze miec tylko 8000
znakow
(wiadomo max. varchar) Wiec co nalzey zrobic abym mogl wczytac dane np.
o wielkosci 100000.
Moze jest jakis inny sposob wczytania XML?
Dzieki z gory za odp. i czekam na rozwiazanie w formie query SQL.

 >> Stay informed about: import danych z xml do ms sql 
Back to top
Login to vote
walczyk

External


Since: Aug 05, 2005
Posts: 2



(Msg. 2) Posted: Fri Aug 05, 2005 2:08 pm
Post subject: Re: import danych z xml do ms sql [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Dodaje jeszcze ze zabraklo miedzy dwoma procedurami kodu z openxml:

SELECT * into tblMyTable
FROM OPENXML (@idoc, '/ROOT/row',1)
WITH
( CustomerID varchar(5) '@CustomerID',
ContactName varchar(15) '@ContactName')

 >> Stay informed about: import danych z xml do ms sql 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
XML Import to SQL - Hi, I am new to the whole XMl import thing and was wondering if someone could help. I will be receiving a XMl file from a client regularly that starts <?xml version="1.0" ?> <!DOCTYPE main [ <!ELEMENT main (DATA_RECORD*)> ...

DB2 Import to SQL 2000 - Hi, I'm doing an import from DB2 into SQL 2000 using DTS. One of my field that I'm bringing over is the zipcode (99999-9999). I'd like to trim it down to only 9 characters and no "-". Can you help me with a query for this? Thank you!

Import folder of XML - I'm Sql7 and have a folder full of XML"S I would like to import into a table. any examples how I could do this ... Thanks.

SQL Server 7 XML File Import? - Is there an easy way to import xml text files into SQL Server 7 or do I need to upgrade to SQL Server 2000 or 2005 and use some of the newer tools?

how to import xml file using ssis - Hi, I want to import xml data using SSIS. I tried using XML source in SSIS. But before loading into table I want to validate if the xml file matches correctly with the .xsd file. How can I do this? If instead of SSIS stored procedure is better approac...
   Database Forums (Home) -> XML All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]