I am getting this Error While I try to do BCP
SQLState = S1000, NativeError = 0
Error = [Microsoft][SQL Server Native Client 11.0]Unable to open BCP host data-file
This is my code:
DECLARE @dump_data1 varchar(500)
SET @dump_data1 = 'bcp "select * from IDcountries.dbo.IDs$" queryout "\\NetworkLocation\watchdog.xls" -c -S STRIVEDI\SQLEXPRESS -T'
EXEC xp_cmdshell @dump_data1
I do have all the rights on Network Drive.
This code perfectly works fine for destination of my local drive like C:\
.
I also tried entering -U
and -P
options as well. But, no luck
Can someone please help me on this issue?
I also faced the same problem. This seems to be permission of the folder. Edit the Security Tab under Folder Properties and give Modify permission to the user account through which SQL Server services are running in the SQL Server. Normally this user account is named as MSSQLSERVER. This worked fine for me.