|
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
Navigation:
[Reply to this message]
|