samedi 9 juillet 2016

How to import an XML file into SQL Server 2012

I have an XML file that I want to import into SQL Server 2012. I haven't done it before and I don't know a lot. After some research, I tried to open the xml file with the following command that was run in SQL Server Management Studio.

SELECT CAST(x as XML) FROM OPENROWSET(
BULK 'C:bulkUsers_test1111.xml',
SINGLE_BLOB
) AS X  

For this I get the following error:

Msg 4861, Level 16, State 1, Line 1
Cannot bulk load because the file "C:bulkUsers_test1111.xml" could not be opened. Operating system error code 3(The system cannot find the path specified.).

What do you suggest to do to get the file into the database?

Aucun commentaire:

Enregistrer un commentaire