So when I am using bcp utility in sql server I got this error. All syntax are fine. I was wandering.
Issue was sql agent’s user not having permission to access host file location.
So first I wanted to know sql agent’s current user.
I used following query to sql server service acounts.
SELECT DSS.servicename, DSS.startup_type_desc, DSS.status_desc, DSS.last_startup_time, DSS.service_account, DSS.is_clustered, DSS.cluster_nodename, DSS.filename, DSS.startup_type, DSS.status, DSS.process_id FROM sys.dm_server_services AS DSS;
Then grant permission to sql agent user. Everything works fine.