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.
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