Re: How to use content of file for xml input?



You write a stored procedure with an ntext typed parameter and you read the
XML on the client and pass it to the stored procedure as a parameter. You
will have to change encoding to UTF-16 on the midtier before you pass it in
though.

Best regards
Michael

"Oliver" <oliver.muenchow@xxxxxx> wrote in message
news:1167740889.192836.302290@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi Everyone,

actually i'm starting to work with OpenXML on SQL Server 2k. At the
examples i found everywhere a variable was defined and filled
hardcode. Something like this:

DECLARE @idoc int
DECLARE @doc varchar(1000)

SET @doc = 'This is the content of my file'
EXEC sp_xml_prepraredocument @idoc OUTPUT, @doc

But i don't have any hardcoded text. I have a lot of xml files, which
liked to be prepared. They size vary from 1 MB to 100 MB and i don't
know how to pass them into the stored procedure.

So can anyone tell me, how a external xml file can be prepared to use
it with sp_xml_preparedocument?? What functions are needed to read the
content of a given file and access it for a stored procedure??

Best regards,
Oliver



.



Relevant Pages

  • Re: Is there a way to convert ms sql 2008 tables to XML files?
    ... Is there a way to convert ms sql 2008 tables to XML files? ... Create a stored procedure which contains the select statement you wish to use. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Shredding XML
    ... to determine which field values should be extracted from an XML doc ... The stored procedure works, but the process of dynamically gathering ... DECLARE keycolumns_cursor CURSOR LOCAL ... DECLARE @xPath varchar ...
    (microsoft.public.sqlserver.xml)
  • RE: Need advice on a Data Import Routine
    ... input data or I would be using XML. ... >> detect when the file arives and prep it for parsing. ... The structure breaks out ... >> used a Stored Procedure to break down the information into the tables. ...
    (microsoft.public.sqlserver.programming)
  • Re: Generate an XML file from a stored procedure?!!
    ... Assuming the stored procedure actually returns XML (i.e. it uses a FOR XML ... you could easily write a VB Script to do this as shown in the ... enterprise manager, dts, or whatever) that I can generate an xml file. ...
    (microsoft.public.sqlserver.programming)
  • Re: Generate an XML file from a stored procedure?!!
    ... Assuming the stored procedure actually returns XML (i.e. it uses a FOR XML ... you could easily write a VB Script to do this as shown in the ... enterprise manager, dts, or whatever) that I can generate an xml file. ...
    (microsoft.public.sqlserver.xml)