SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Using Bulk Insert- Error- file cannot be opened
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

aahmed99
Starting Member

1 Posts

Posted - 01/30/2013 :  16:52:59  Show Profile  Reply with Quote
I am trying upload a CSV file into SQL Server using the following query:

BULK INSERT intrf_payer_mstr
FROM 'C:\Users\ihsuser\Desktop\edmondson.csv'
WITH (FIELDTERMINATOR=',',rowterminator='\n')

When I attempt to execute, I keep getting an error saying that my query cannot bulk load because the file "C:\Users\ihsuser\Desktop\edmondson.csv" could not be opened. Operating system error code 5 (Access is denied).

Has anyone encountered this problem before, or does anyone know how I can correct this issue? The file is a simple text file and has no blocks or passwords on it.

Any assistance with this would be much appreciated.

robvolk
Most Valuable Yak

USA
15675 Posts

Posted - 01/30/2013 :  17:03:49  Show Profile  Visit robvolk's Homepage  Reply with Quote
C:\Users\ihsuser\Desktop\edmondson.csv refers to your desktop machine, not the SQL Server's disks. Copy the file to a local drive on the server, or better yet to a file share. Use a UNC path rather than local, e.g. \\computer\path\filename.csv
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000