August 23, 2005 at 9:38 am
For starters, no need to reply that use of xp_cmdshell is dangerous. The following is merely to illustrate the symptoms of a problem I am having.
Execute xp_cmdshell 'dir \\UNC\Path' returns "The system cannot find the file specified.". Running dir \\unc\path at the command prompt returns the correct directory listing. SQL Server is running under my id and I am logged into SQL Server as sa. Also, \\UNC\Path points to a Novell Server. I had this working on another machine (which is no longer in service, so I can't compare settings).
The real problem is that I had a script that automated retrieval of files from source safe that is located on the Novell share. Worked on the old machine but does not work on my new machine, due to the inability to find the share as noted above.
Any and all suggestions are welcomed, as I have tried everything I can think of.
Gordon
Gordon Pollokoff
"Wile E. is my reality, Bugs Bunny is my goal" - Chuck Jones
August 23, 2005 at 10:30 am
Did you try to use double quotes before and after the unc path? If the UNC path has characters such as '&', you will receive the error you mentioned.
SET QUOTED_IDENTIFER OFF
GO
Execute xp_cmdshell 'dir "\\UNC\Path"'
GO
This works on my machine.
August 23, 2005 at 11:41 am
that's not it. The problem seems to be that although SQL Server is running under my ID, it doesn't have quite the same credentials that I have running in the command shell.
Gordon Pollokoff
"Wile E. is my reality, Bugs Bunny is my goal" - Chuck Jones
August 23, 2005 at 12:13 pm
Gordon,
You may need to create a local user (yourself) on the Novell server. Then try the xp_cmdshell again.
If that fails, create a mapped drive On SQL Server machine, pointing to the Novell path.
I could be wrong, but seems I remember that I had to do 1 of those steps to get mine to work.
John
August 23, 2005 at 5:15 pm
I think it is SQL Server Agent dependent try the links below for permission configuration. And I would also check the network configuration to add the Novel protocols SPX/IPX. Hope this helps.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_xp_aa-sz_8sdm.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_xp_aa-sz_4jxo.asp
Kind regards,
Gift Peddie
Kind regards,
Gift Peddie
August 23, 2005 at 6:52 pm
Try
Exec master..xp_cmdshell 'Echo %USERNAME%'
and see what is returned
Dave Henderson
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply