364,111 Members | 2051 Browsing Online
Community for Developers & IT Professionals
Bytes IT Community

Bulk Insert Command

Mike
P: n/a
Mike
I am trying to use the 'Bulk Insert' command to load a data file into a
MS-SQL db. The line I am using is:

Bulk Insert SVC_Details From "C:\XFILE.TXT" With (FieldTerminator = ',')

I have tried the file name with " around it and with ' around it and both
the " and ', but every time the Query Analyzer comes back with the following
error:

---Begin Error Msg---
Server: Msg 4861, Level 16, State 1, Line 1
Could not bulk insert because file ''C:\XFILE.TXT'' could not be opened.
Operating system error code 123(The filename, directory name, or volume
label syntax is incorrect.).
---End Msg---

I am not sure what is wrong with this line. Can any one tell me what is
wrong?

Mike
m charney at dunlap hospital dot org


Oct 13 '05 #1
Share this Question
Share on Google+
1 Reply


Michael Houmaark
P: n/a
Michael Houmaark
Do not use " but use ' and be sure that the file is there

i have uset this query

bulk insert tlf.dbo.bruger_data from 'C:\TEKST.txt'
with
(
FIRSTROW = 1,
FIELDTERMINATOR = '";"',
ROWTERMINATOR = '"\n'
)

"Mike" <noway@forgetit.com> skrev i en meddelelse
news:66x3f.181$aV5.91@newssvr30.news.prodigy.com.. .[color=blue]
>I am trying to use the 'Bulk Insert' command to load a data file into a
>MS-SQL db. The line I am using is:
>
> Bulk Insert SVC_Details From "C:\XFILE.TXT" With (FieldTerminator = ',')
>
> I have tried the file name with " around it and with ' around it and both
> the " and ', but every time the Query Analyzer comes back with the
> following error:
>
> ---Begin Error Msg---
> Server: Msg 4861, Level 16, State 1, Line 1
> Could not bulk insert because file ''C:\XFILE.TXT'' could not be opened.
> Operating system error code 123(The filename, directory name, or volume
> label syntax is incorrect.).
> ---End Msg---
>
> I am not sure what is wrong with this line. Can any one tell me what is
> wrong?
>
> Mike
> m charney at dunlap hospital dot org
>
>[/color]


Oct 13 '05 #2

Post your reply

Help answer this question



Didn't find the answer to your Microsoft SQL Server question?

You can also browse similar questions: Microsoft SQL Server