|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Re: Simple Bulk Insert ProblemHello!
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. 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. 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. 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. -- Show quote-oj "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. |
|||||||||||||||||||||||