Solved

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

Posted on 2003-11-06
4
1,233 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

690 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