Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 Error = [Microsoft][SQL Native Client]Unable to op

Author  Topic 

rmaffrand
Starting Member

2 Posts

Posted - 2008-05-02 : 10:19:35
As long as the output file is written to the local client, it completes successfully. But after changing the UNC path to another server with or without fully qualified names it is unable to open BCP host data-file. (sample shown below)
-----------------------------------------------------------------
DECLARE @FileName varchar(2000),
@bcpCommand varchar(2000)

SET @FileName = REPLACE('\\stladmin\y_drive\transfer\rmaffrand\authors_'+CONVERT(char(8),GETDATE(),1)+'.txt','/','-')

SET @bcpCommand = 'bcp "SELECT * FROM FKIAcctReceivable.dbo.PurchaseOrder" queryout "'
SET @bcpCommand = @bcpCommand + @FileName + '" -T -c'

EXEC master..xp_cmdshell @bcpCommand

---------------------------------------------------
xp_cmdshell has been enabled and the user has sysadmin rights.

Anybody have the same problem and willing to help?

mfemenel
Professor Frink

1421 Posts

Posted - 2008-05-02 : 10:53:32
The user has sysadmin to sql? I don't think that's relavent wouldn't they need rights to that server to write a file to the drive?

Mike
"oh, that monkey is going to pay"
Go to Top of Page

rmaffrand
Starting Member

2 Posts

Posted - 2008-05-02 : 11:11:05
Thank you for the quick response. The destination server open to the public and has folders shared to the user with full rights. What other rights are needed?
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-05-03 : 13:04:03
Sql service account needs permission on remote files.
Go to Top of Page
   

- Advertisement -