Solved

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

Posted on 2003-11-06
4
1,226 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
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.

746 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

11 Experts available now in Live!

Get 1:1 Help Now