Home All Groups Group Topic Archive Search About

Re: Simple Bulk Insert Problem

Author
13 May 2005 1:52 PM
Andre Olin
Hello!

I am a newbie in XML things.
My task is to import XML file into MS SQL server.

I tried to execute the following code:

BULK INSERT dbo.XML_datnes_paraugs
  FROM 'C:\reports.xml

and here is the result:

Server: Msg 4860, Level 16, State 1, Line 1
Could not bulk insert. File 'C:\reports.xml' does not exist.

How can I solve the problem?
Server is running far away, and the reports.xml is a local file.

Author
13 May 2005 3:13 PM
JT
For the bulk insert command, the referenced path/filename is within the
context of the server's filesystem not your local filesystem. Does
C:\reports.xml exist on the server? Perhaps you can copy the file to a
folder on the server via FTP or network share.

Show quote
"Andre Olin" <Andre O***@discussions.microsoft.com> wrote in message
news:AF30F743-9D15-43A4-9D37-BD1014C70665@microsoft.com...
> Hello!
>
> I am a newbie in XML things.
> My task is to import XML file into MS SQL server.
>
> I tried to execute the following code:
>
> BULK INSERT dbo.XML_datnes_paraugs
>   FROM 'C:\reports.xml
>
> and here is the result:
>
> Server: Msg 4860, Level 16, State 1, Line 1
> Could not bulk insert. File 'C:\reports.xml' does not exist.
>
> How can I solve the problem?
> Server is running far away, and the reports.xml is a local file.
Author
13 May 2005 4:11 PM
Sarav
The common mistake I have seen is that the XML files are stored in the user
computer not on the database server.

if you have the reports.xml on your local C: copy it to the C:\ of the
database server. because the SQL script runs on the server not on the client
and SQL Server looks for the file on the database server.

regards,
Sarav...

Show quote
"Andre Olin" <Andre O***@discussions.microsoft.com> wrote in message
news:AF30F743-9D15-43A4-9D37-BD1014C70665@microsoft.com...
> Hello!
>
> I am a newbie in XML things.
> My task is to import XML file into MS SQL server.
>
> I tried to execute the following code:
>
> BULK INSERT dbo.XML_datnes_paraugs
>  FROM 'C:\reports.xml
>
> and here is the result:
>
> Server: Msg 4860, Level 16, State 1, Line 1
> Could not bulk insert. File 'C:\reports.xml' does not exist.
>
> How can I solve the problem?
> Server is running far away, and the reports.xml is a local file.
Author
13 May 2005 10:28 PM
oj
Bulk insert is a server process. The path is local to the server.

If you're loading the data from your desktop, consider using bcp client
tool.

--
-oj


Show quote
"Andre Olin" <Andre O***@discussions.microsoft.com> wrote in message
news:AF30F743-9D15-43A4-9D37-BD1014C70665@microsoft.com...
> Hello!
>
> I am a newbie in XML things.
> My task is to import XML file into MS SQL server.
>
> I tried to execute the following code:
>
> BULK INSERT dbo.XML_datnes_paraugs
>  FROM 'C:\reports.xml
>
> and here is the result:
>
> Server: Msg 4860, Level 16, State 1, Line 1
> Could not bulk insert. File 'C:\reports.xml' does not exist.
>
> How can I solve the problem?
> Server is running far away, and the reports.xml is a local file.

AddThis Social Bookmark Button