Reputation: 109
I am trying to run command Invoke-Sqlcmd via powershell using gma account and trying to insert into table through bulk insert.
Job is running on Windows server and SQL server is remote. Command provided is :
bulk insert TABLE FROM "\\Server\Drive$\FILENAME.csv" WITH (ROWS_PER_BATCH = 123, FIELDTERMINATOR = '|#|');
Error I am getting is
Cannot bulk load because the file "\Server\Drive$\FILENAME.csv" could not be opened. Operating system error code 5(Access is denied.).
What can we do to resolve this? Few article says to use the SQL Authentication rather than domain account, however we need to run the job using Task Scheduler on Windows server and need domain gma account to automate this.
Upvotes: 0
Views: 84