August 7, 2008 at 3:46 pm
Hello to everyone, I try to explain my problem, i need with BCP utility put a file in remote machine, I writed this script exec master..xp_cmdshell 'bcp sysobjects out \\machine\direcoty\out.txt -T -w', allways this send a error, I've been searching information but I don't find some, only to reverse, put file in local path since a remote server, we have a sql server 2000 SP4 with windows server 2003 SP2, thank for you help
Angel Miranda Nieto
DBA Specialist, BI, MCSA SQL Server
August 7, 2008 at 7:08 pm
Angel Miranda Nieto (8/7/2008)
Hello to everyone, I try to explain my problem, i need with BCP utility put a file in remote machine, I writed this script exec master..xp_cmdshell 'bcp sysobjects out \\machine\direcoty\out.txt -T -w', allways this send a error, I've been searching information but I don't find some, only to reverse, put file in local path since a remote server, we have a sql server 2000 SP4 with windows server 2003 SP2, thank for you help
I want to ask some questions if you don't mind...
1. what is the error message?
2. do you have appropriate permission to the remote machine?
3. do you have permission to use xp_cmdshell?
I did try your script and it works for me
Can you please try the script below..
change dname = database name
change db_owner = your database owner
exec master..xp_cmdshell 'bcp "dbname.db_owner.sysobjects" out "\\machine\directory\out.txt" -T -w'
"-=Still Learning=-"
Lester Policarpio
August 7, 2008 at 7:51 pm
Angel Miranda Nieto (8/7/2008)
Hello to everyone, I try to explain my problem, i need with BCP utility put a file in remote machine, I writed this script exec master..xp_cmdshell 'bcp sysobjects out \\machine\direcoty\out.txt -T -w', allways this send a error, I've been searching information but I don't find some, only to reverse, put file in local path since a remote server, we have a sql server 2000 SP4 with windows server 2003 SP2, thank for you help
What is the exact error you're getting?
--Jeff Moden
Change is inevitable... Change for the better is not.
August 8, 2008 at 9:00 am
thanks foy you aswer, the error is
SQLState = S1000, NativeError = 0
Error = [Microsoft][ODBC SQL Server Driver]Unable to open BCP host data-file
NULL
I believe that is permmisions or security, because I did the test to another server and it worked, which is the logic of permits for the execution to achieve?
Angel Miranda Nieto
DBA Specialist, BI, MCSA SQL Server
August 8, 2008 at 7:08 pm
You are correct... BCP can write anywhere that the server can "see". The SQL Server SERVICE must have a Windows Server login that can "see" the UNC path that you're trying to write to. In Enterprise Manager, right click on the server instance, select [Properties], go to the [Security] tab, and it's at the bottom of that tab.
--Jeff Moden
Change is inevitable... Change for the better is not.
August 11, 2008 at 10:34 am
thank everyone, my problem is solved, we are in contact
Angel Miranda Nieto
DBA Specialist, BI, MCSA SQL Server
August 11, 2008 at 7:12 pm
Angel Miranda Nieto (8/11/2008)
thank everyone, my problem is solved, we are in contact
Two way street here, Angel... tell us how you solved your problem, please. 🙂
--Jeff Moden
Change is inevitable... Change for the better is not.
August 12, 2008 at 2:02 pm
was easy, only gave all permissions to the domain account that run the sql services in the remote server on the path where I'll put the file
Angel Miranda Nieto
DBA Specialist, BI, MCSA SQL Server
August 12, 2008 at 5:57 pm
Thanks, Angel. 🙂
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply