SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


BULK INSERT ERROR


BULK INSERT ERROR

Author
Message
shaikwaseem888
shaikwaseem888
Grasshopper
Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)

Group: General Forum Members
Points: 16 Visits: 3
Dear Friends,

i am new in this forum and i hope that i will get the solution to this error.

actually, i want to import bulk data into the server table but literally failing below of the error mentioned below, i have tried both the ways using .txt and .csv files but still fails.

Cannot bulk load because the file "‪C:\Users\Shaik\Desktop\Import.csv" could not be opened. Operating system error code 123(The filename, directory name, or volume label syntax is incorrect.).


BULK INSERT PhoneBook
FROM '‪C:\Users\Shaik\Desktop\Import.csv'
WITH

(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO


i dont know how to solve it, Please have a look a try to give me your responses.

Thanks
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (816K reputation)SSC Guru (816K reputation)SSC Guru (816K reputation)SSC Guru (816K reputation)SSC Guru (816K reputation)SSC Guru (816K reputation)SSC Guru (816K reputation)SSC Guru (816K reputation)

Group: General Forum Members
Points: 816398 Visits: 46262
shaikwaseem888 - Saturday, December 30, 2017 3:24 PM
Dear Friends,

i am new in this forum and i hope that i will get the solution to this error.

actually, i want to import bulk data into the server table but literally failing below of the error mentioned below, i have tried both the ways using .txt and .csv files but still fails.

Cannot bulk load because the file "‪C:\Users\Shaik\Desktop\Import.csv" could not be opened. Operating system error code 123(The filename, directory name, or volume label syntax is incorrect.).


BULK INSERT PhoneBook
FROM '‪C:\Users\Shaik\Desktop\Import.csv'
WITH

(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO


i dont know how to solve it, Please have a look a try to give me your responses.

Thanks


Unless the server is on your desktop (or lap top) where the "‪C:\Users\Shaik\Desktop\Import.csv" file lives, the server won't be able to see the file. Even if it does live on the same box as the file, it may still not be able to see the file because it's (apparently) in your user directory and the server may not have privs to access that folder. Even if the server can see the file, it won't be able to open it if another application (other than NotePad) has it open (for example, you have the file open in Excel).



You can solve this issue by granting the SQL Server logins privs the machine/drive/folder where the file lives and we can help with that, but we first need to know where all the pieces live..
Since it IS BULK INSERT, we may have to do a little song and dance to get things to work depending on what your privs on the server are.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Subramaniam Chandrasekar
Subramaniam Chandrasekar
Hall of Fame
Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)

Group: General Forum Members
Points: 3228 Visits: 531
shaikwaseem888 - Saturday, December 30, 2017 3:24 PM
Dear Friends,

i am new in this forum and i hope that i will get the solution to this error.

actually, i want to import bulk data into the server table but literally failing below of the error mentioned below, i have tried both the ways using .txt and .csv files but still fails.

Cannot bulk load because the file "‪C:\Users\Shaik\Desktop\Import.csv" could not be opened. Operating system error code 123(The filename, directory name, or volume label syntax is incorrect.).


BULK INSERT PhoneBook
FROM '‪C:\Users\Shaik\Desktop\Import.csv'
WITH

(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO


i dont know how to solve it, Please have a look a try to give me your responses.

Thanks

Could you please also check on the syntax.
pietlinden
pietlinden
SSC-Forever
SSC-Forever (49K reputation)SSC-Forever (49K reputation)SSC-Forever (49K reputation)SSC-Forever (49K reputation)SSC-Forever (49K reputation)SSC-Forever (49K reputation)SSC-Forever (49K reputation)SSC-Forever (49K reputation)

Group: General Forum Members
Points: 49695 Visits: 16182
It's probably not a syntax issue. It's a permissions issue. If it were a syntax issue, the code would stop and you'd get an error message that the T-SQL "statement failed on line number X..."
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search