Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

running os commands in sql server (again!!) 2

Status
Not open for further replies.

nuct

Programmer
Sep 5, 2001
103
I use this command which works perfectly when I run it in the dos window (ftp utility):

cftp -s 10.246.154.204 -u import -p import -l "c:\test"

and it returns this if I use it in SQL Server:

The name specified is not recognized as an
internal or external command, operable program or batch file.

I think I've tried everything and the only conclusion I can come to is that sql server is rubbish. Any ideas?

Cheers

Simon.
 
nuct

What do you mean by "use it in SQL Server"?

 
Are you running this command via xp_cmdshell?

Thanks

J. Kusch
 
If not, the command would look like this ...
Code:
exec master.dbo.xp_cmdshell 'cftp -s 10.246.154.204 -u import -p import -l "c:\test" '

Thanks

J. Kusch
 
yeah, sorry i was a bit flustered. I mean run it as a command exec step in a job.

Simon
 
and when I use the exact "xp_cmdshell" line in above post it come up with the error:

"The name specified is not recognized as an
internal or external command, operable program or batch file.
 
I'd put the explicit path to the executable in the statement. I think SQL's looking in the wrong place for it.

Phil Hegedusich
Senior Web Developer
IIMAK
-----------
Boy howdy, my Liberal Studies degree really prepared me for this....
-----------
A skeleton walks into a bar, and says "I'll have a beer and a mop.
 
nuct

If you mean in a .bat or .cmd file, try the following..

start cftp.exe ..........

I looked on my desktop, and I have an ftp.exe, but not a cftp.exe, but the use of the "start" command, and using the .exe extension should get you what you want.

 
cheers for tips, finally got it working using the NT scheduler of all things. Pretty rubbish but at least it works. I will look into all your suggestions when I next need to do this.

Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top