Saturday, February 25, 2012

run a dos command?

Hi all,
I am just wondering is there a way to run a dos command in the stored procedure? Please fill me in on how to go about doing if is there is a way. If this is not the correct forum to post this question, please let me know. Thanks in advance.
Daren

Hi faren,

you can open up a shell with XP_cmdshell and execute commands via passing the command as a paramter:

EXEC MASTER.XP_CMDSHELL 'dir C:\'

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

No comments:

Post a Comment