How to use content of file for xml input?



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: 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. ... I have a lot of xml files, ...
    (microsoft.public.sqlserver.xml)
  • Stored Procedures & XML Scehma
    ... Ive been trying to use XMl files, with limited sucsess, but now have been ... issued with the Schema for the files. ... Stored procedure to create and import the data to a temp table then work from ...
    (microsoft.public.sqlserver.xml)