I'm trying to import an XML fie into SQL server 2000(SP2) table. I tried below query and it's giving syntax error near the word BULK. Not entirely sure if BULK and SINGLE_BLOB work in SQL 2000 sp2.
SELECT * FROM OPENROWSET(BULK N'E:\temp\PersonData.xml', SINGLE_BLOB) AS x
Also tried below query....
SELECT * FROM OPENROWSET('MSDASQL',
'Driver={Microsoft Text Driver (*.xml)};DefaultDir=E:\temp\PersonData.xml;',
'SELECT * FROM [PersonData.xml];' )
....and it gave this error. [OLE/DB provider returned message: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified] OLE DB error trace [OLE/DB Provider 'MSDASQL' IDBInitialize::Initialize returned 0x80004005: ].
Am I doing wrong here? or Is it SQL server 2000 issue?. My goal is to import an XML file into SQLserver using a stored proc. Can't upgrade the server nor can I use a third party tool. Within these boundaries, please suggest me a way to achieve this. Thanks in advance.
No comments:
Post a Comment