Solved

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

Posted on 2003-11-06
4
1,228 Views
Last Modified: 2012-06-27
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
Comment
Question by:lussier
  • 2
  • 2
4 Comments
 
LVL 58

Expert Comment

by:amit_g
ID: 9696408
You can call extended stored procedure xp_cmdshell.

EXEC master..xp_cmdshell 'dir *.exe'
0
 
LVL 15

Accepted Solution

by:
namasi_navaretnam earned 500 total points
ID: 9696464
EXEC master..xp_cmdshell 'c:\yourbatchfile.bat'

This file ('c:\yourbatchfile.bat'
) should be on the PC where sql server is installed
0
 
LVL 58

Expert Comment

by:amit_g
ID: 9696650
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
 
LVL 15

Expert Comment

by:namasi_navaretnam
ID: 9696805
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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now