SQLState = S1000, NativeError = 0, Error = [Microsoft][SQL Server Native Client 10.0]Unable to open BCP host data-file

trying to bcp out a file over the network, can get it to work locally
path i am using is

EXEC master..xp_cmdshell 'bcp "select * from mydatabase.dbo.myview" queryout "\\SERVER2\IT\DIRECTORY\sample.xls" -c -t\t -T -SSERVER1'

getting this error

SQLState = S1000, NativeError = 0
Error = [Microsoft][SQL Server Native Client 10.0]Unable to open BCP host data-file

permissions on the destination server are open to everyone, folder is shared.


I have tried running this query using a domain account we have setup for both network and sql.
still getting the same error

Amanda WalshawBusiness Solutions AnalsystAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
geek_vjCommented:
This issue happens due to one of the below reasons:

1) The path/filename is incorrect (check your typing / spelling)

2) The file does not exist. (make sure the file is where you expect it to be)

3) The file is already open by some other app. (close the other app to release the file)

Ensure that you map the destination drive and provide full priveleges to your sql server account.

Please revert in case of any queries.
Amanda WalshawBusiness Solutions AnalsystAuthor Commented:
found that it was prvileges, sql has issues outputting to a hidden share, once created a new directory all okay
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.