Reply to Re: xp_cmdshell

Your name:

Reply:


Posted by Erland Sommarskog on 12/18/06 22:30

tolcis (nytollydba@gmail.com) writes:
> I have a batch file (.bat) that I need to execute inside my stored
> procedure (SQL 2000).
> I am trying to call that batch file using xp_cmdshell command. I am
> probably not using it the right way but I am trying to pass a path of
> the batch file into xp_cmdshell and it doesn't recognizes it as a
> command.
> Can you anybody help me with the syntax?

Where is the batch file located? Keep in mind that the PATH from xp_cmdshell
is not your PATH, but one set up for the service account of SQL Server.
You are best specifying the full search path to the BAT file. Also,
keep in mind that if SQL Server is running on a different machine, a
batch file on your local computer won't do.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация