Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQLState = S1000, NativeError = 0

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?

like image 681
user2704062 Avatar asked Oct 17 '13 20:10

user2704062


1 Answers

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.

like image 197
Sanjeev Garg Avatar answered Sep 21 '22 21:09

Sanjeev Garg