473,772 Members | 3,665 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Import XML file to database (MS Server 2000) using procedure (transact sql) ???

I must import some exemplary file to database (MS Srrver 2000) ofcourse
using procedure Transact SQL.
This file must:
1.Read the xml file
2. Create table
3. Import this date from xml file to my database

Ps. I create procedure who File xml imports to base, but unfortunately she
only schedule when earlier create a table or table is created.So I need (I
think) create such mini parser in language transact SQL.
Does someone have some ideas?

For every help Thanks

==== example file xml =============== =============== =============
<root>
<Cust>
<IDosoby>1</IDosoby>
<Imie>Lukasz</Imie>
<Nazwisko>Przyp adek</Nazwisko>
</Cust>
<Cust>
<IDosoby>2</IDosoby>
<Imie>Dariusz </Imie>
<Nazwisko>Mro z</Nazwisko>
</Cust>
<Cust>
<IDosoby>3</IDosoby>
<Imie>Tomasz</Imie>
<Nazwisko>Kol o</Nazwisko>
</Cust>
</root>
=============== =============== =============== ==============
--
Luk

Jul 20 '05 #1
3 5456
Not sure of the exact requirement. But if you can parse the XML and then
using OPENXML shred it into a new table.

SELECT * INTO <MyNewTable>
FROM OPENXML (@idoc, '/root/')

Where @idoc is the document handle of the internal representation of an XML
document.

--
HTH,
Vinod Kumar
MCSE, DBA, MCAD, MCSD
http://www.extremeexperts.com

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp

"Szaki" <lj**@gazeta.pl > wrote in message
news:cm******** **@inews.gazeta .pl...
I must import some exemplary file to database (MS Srrver 2000) ofcourse
using procedure Transact SQL.
This file must:
1.Read the xml file
2. Create table
3. Import this date from xml file to my database

Ps. I create procedure who File xml imports to base, but unfortunately she
only schedule when earlier create a table or table is created.So I need (I think) create such mini parser in language transact SQL.
Does someone have some ideas?

For every help Thanks

==== example file xml =============== =============== =============
<root>
<Cust>
<IDosoby>1</IDosoby>
<Imie>Lukasz</Imie>
<Nazwisko>Przyp adek</Nazwisko>
</Cust>
<Cust>
<IDosoby>2</IDosoby>
<Imie>Dariusz </Imie>
<Nazwisko>Mro z</Nazwisko>
</Cust>
<Cust>
<IDosoby>3</IDosoby>
<Imie>Tomasz</Imie>
<Nazwisko>Kol o</Nazwisko>
</Cust>
</root>
=============== =============== =============== ==============
--
Luk

Jul 20 '05 #2
Hi
May be it is not exactly what you wanted but I ma sure you will get an idea.

declare @list varchar(8000)
declare @hdoc int
set @list='<Northwi nd..Orders OrderId="10643"
CustomerId="ALF KI"/><Northwind..Or ders OrderId="10692" CustomerId="ALF KI"/>'
select @list='<Root>'+ char(10)+@list
select @List = @List + char(10)+'</Root>'
exec sp_xml_prepared ocument @hdoc output, @List

select OrderId,Custome rId
from openxml (@hdoc, '/Root/Northwind..Orde rs', 1)
with (OrderId int,
CustomerId varchar(10)
)
exec sp_xml_removedo cument @hdoc

"Szaki" <lj**@gazeta.pl > wrote in message
news:cm******** **@inews.gazeta .pl...
I must import some exemplary file to database (MS Srrver 2000) ofcourse
using procedure Transact SQL.
This file must:
1.Read the xml file
2. Create table
3. Import this date from xml file to my database

Ps. I create procedure who File xml imports to base, but unfortunately she
only schedule when earlier create a table or table is created.So I need (I think) create such mini parser in language transact SQL.
Does someone have some ideas?

For every help Thanks

==== example file xml =============== =============== =============
<root>
<Cust>
<IDosoby>1</IDosoby>
<Imie>Lukasz</Imie>
<Nazwisko>Przyp adek</Nazwisko>
</Cust>
<Cust>
<IDosoby>2</IDosoby>
<Imie>Dariusz </Imie>
<Nazwisko>Mro z</Nazwisko>
</Cust>
<Cust>
<IDosoby>3</IDosoby>
<Imie>Tomasz</Imie>
<Nazwisko>Kol o</Nazwisko>
</Cust>
</root>
=============== =============== =============== ==============
--
Luk

Jul 20 '05 #3
Thanks,
Could you correct my procedure that she acted correctly, becouse I'm a
beginning programist.
thanks for any help
U¿ytkownik "Vinod Kumar" <vinodk_sct@NO_ SPAM_hotmail.co m> napisa³ w
wiadomo¶ci news:cm******** **@news01.intel .com...
Not sure of the exact requirement. But if you can parse the XML and then
using OPENXML shred it into a new table.

SELECT * INTO <MyNewTable>
FROM OPENXML (@idoc, '/root/')

Where @idoc is the document handle of the internal representation of an XML document.

--
HTH,
Vinod Kumar
MCSE, DBA, MCAD, MCSD
http://www.extremeexperts.com

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp

"Szaki" <lj**@gazeta.pl > wrote in message
news:cm******** **@inews.gazeta .pl...
I must import some exemplary file to database (MS Srrver 2000) ofcourse
using procedure Transact SQL.
This file must:
1.Read the xml file
2. Create table
3. Import this date from xml file to my database

Ps. I create procedure who File xml imports to base, but unfortunately she only schedule when earlier create a table or table is created.So I need

(I
think) create such mini parser in language transact SQL.
Does someone have some ideas?

For every help Thanks

==== example file xml =============== =============== =============
<root>
<Cust>
<IDosoby>1</IDosoby>
<Imie>Lukasz</Imie>
<Nazwisko>Przyp adek</Nazwisko>
</Cust>
<Cust>
<IDosoby>2</IDosoby>
<Imie>Dariusz </Imie>
<Nazwisko>Mro z</Nazwisko>
</Cust>
<Cust>
<IDosoby>3</IDosoby>
<Imie>Tomasz</Imie>
<Nazwisko>Kol o</Nazwisko>
</Cust>
</root>
=============== =============== =============== ==============
--
Luk


Jul 20 '05 #4

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

Similar topics

3
7891
by: M1st3rK3n | last post by:
I'm using the Transact-SQL Debugger for the first time here. I go to Object Browser, find my stored procedure, right click and choose "Debug". The "Debug Procedure" window comes up, and I click on the Execute button. The Debug environment comes up and automatically executes my procedure. It doesn't allow me to single step through the code.
2
5267
by: Szaki | last post by:
Hello, I have a some xml file and database. How import this file to database? I must do aplication in VB .NET whose show imports some xml file to database SQL SERVER 2000? Do you have any idea? or mayby sombody have some aplication who show this problem. Txh for some advice. --
2
2471
by: Manish Naik | last post by:
Hi, Using ASP.Net, I want to store and retrive documents (Word, excel, etc) from SQL Server 2000 database. I have tried image type data field, but could not succed. Can any one help me please. Regards, Manish Naik
1
1320
by: davidman73 | last post by:
Hello, I have VS 2005 with SQL Server Express in the same machine, but need to connect to a remote SQL Server 2000. I'm getting this error: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to...
0
1482
by: Stanley Sin | last post by:
Dear all , How can I remote access SQL server 2000 using vb.net? I don't know how to use ADO.net to remote access database . Any solutions? Thanks in advance. Stanley
0
2208
by: Emanuele | last post by:
I have write a program using MS Visual studio C++ 7.0 (platform Windows XP professional). I'm not using .NET. This program save data in a SQL server 2000 database using ADO. Everything works correctly, yet if i stop the sql service and then restart it, while the programs write records, the reconnection to the server dont't work. When the service stops i catch all the exceptions. I want try to reconnect to the database continually till...
4
2288
by: jayfeb29 | last post by:
Hi , Any one can guide me in Import the Excel 2002 data into sql server 2000 using ado.net1.1. I have searched all the forums most of the solutions end with a line of suggestion not with any code . here is my code . by using OLEDB JET I got the data from Excel to data set , the data is in the data table OleDbConnection strConn = new OleDbConnection ("Provider=Microsoft.Jet.OLEDB.4.0;data source= c:\\1005.xls;Extended...
0
1337
by: adhimoolamd | last post by:
Dear Friend’s, I need your help’s here to print the pdf file at server side using network printers. Here I am using System.Diagnostic.process namespace to print the pdf file. The problem is system not throwing any error. Executing fine, but no output in printer. But the same code is working and printing pdf files in ASP.NET Development Server and windows application. It’s not working for IIS 6.0.
0
1546
by: madhusr | last post by:
I have a requirement where in in I need to call a SQL Server 2000 stored procedure from DB2 (ver 8.x) based on a value in a column. I can create a trigger in DB2 to monitor the column and after the value is set to a specific value, I want to call the stored procedure on SQL server. Can anyone point me to a place where I can find some help on this?
0
9620
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10261
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9912
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7460
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.