Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1240
  • Last Modified:

Call Exe or batch file in a trigger or in a store procedure

I would like to know if i can call a program EXE (.exe) or a batch file (.bat) by in Trigger or a Store Procedure. If so, how? Thanks
0
lussier
Asked:
lussier
  • 2
  • 2
1 Solution
 
amit_gCommented:
You can call extended stored procedure xp_cmdshell.

EXEC master..xp_cmdshell 'dir *.exe'
0
 
namasi_navaretnamCommented:
EXEC master..xp_cmdshell 'c:\yourbatchfile.bat'

This file ('c:\yourbatchfile.bat'
) should be on the PC where sql server is installed
0
 
amit_gCommented:
lussier, you are new to this forum but for the next time please note that if you have more than one identical answers, accept either the first one or split the point between all of them. Please spend few minutes reading the help ...

http://www.experts-exchange.com/help.jsp#hi19
0
 
namasi_navaretnamCommented:
Agree with Amit. I did not see your response. i have mutiple windows opened and some times i do not see what  others have posted. But I think, lussier picked a more specific answer in this case though.

Regards.
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now