Is there a way to import an XML file into a SQL2000 table? I can only find information on how to retrieve the XML data from a query.
I have tried:
DECLARE @idoc int
DECLARE @doc varchar(1000)
SET @doc ='E:\XmlFiles\ENICOpen.xml'
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @idoc OUTPUT, @doc
-- Execute a SELECT statement that uses the OPENXML rowset provider.
SELECT *
FROM OPENXML (@idoc, '/insurity /CSR',1)
WITH (ENICNo_Number varchar(10),
InsurityNumber varchar(20),
EffectiveDate datetime)
But I get this error:
Server: Msg 6603, Level 16, State 1, Procedure sp_xml_preparedocument, Line 5
XML parsing error: Invalid at the top level of the document
TIA,
Joe
I have tried:
DECLARE @idoc int
DECLARE @doc varchar(1000)
SET @doc ='E:\XmlFiles\ENICOpen.xml'
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @idoc OUTPUT, @doc
-- Execute a SELECT statement that uses the OPENXML rowset provider.
SELECT *
FROM OPENXML (@idoc, '/insurity /CSR',1)
WITH (ENICNo_Number varchar(10),
InsurityNumber varchar(20),
EffectiveDate datetime)
But I get this error:
Server: Msg 6603, Level 16, State 1, Procedure sp_xml_preparedocument, Line 5
XML parsing error: Invalid at the top level of the document
TIA,
Joe