Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Load an XML-file with a stored procedure

Author  Topic 

erde
Starting Member

6 Posts

Posted - 2001-11-26 : 06:19:28
Anyone know if it is possible to load an xml file with a stored procedure. All the examples I find into the BOL are working with short documents, stored into a local variable defined as varchar(1000). But I need to load a file of possibly more than 10K.

Edited by - erde on 11/26/2001 08:27:32

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2001-11-26 : 06:56:33
Hi

There is a solution here

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=9336

from Rob Volk and his alter ego "roy"

It involves BCP-ing the data into the text file.

Hope it helps


Damian - SQLTeam forum archive-knowing-guy
Go to Top of Page

erde
Starting Member

6 Posts

Posted - 2001-11-26 : 08:23:41
Merkin,
Yes I know about this topic, but I want it just the other way. I want to LOAD a received XML-file INTO my SQL-server database.


Edited by - erde on 11/26/2001 08:25:08

Edited by - erde on 11/26/2001 08:25:37
Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2001-11-26 : 08:37:31
Ahhhh I understand now..

There is a good site I have just started looking around at www.sqlxml.org

There is an article here http://www.sqlxml.org/sqlxml/v3.1/faqs.xml?faq=39&browser=ie that might help.



Damian
Go to Top of Page

erde
Starting Member

6 Posts

Posted - 2001-11-26 : 09:40:36
OK, there is an example with a stored procedure (CREATE PROC update_employee @empdata text AS ...). But the problem isn't solved. Just as the descriptions into BOL, you can't load more than 8000 characters.
The example assumes you give a TEXT-parameter with the stored procedure to execute. I don't know any possibility to define a local variable 'AS TEXT' into a sql-script. I need to load files of more than 10K.

Thanks for the help.
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2001-11-26 : 11:12:20
Take a look at Ilya's code near the end of this:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=10245

It's not complete, but it might give you some ideas that you can use to accomplish this. I have been wanting to do the exact same thing you are, and it's aggravating that this isn't easier to do.

Go to Top of Page
   

- Advertisement -