473,320 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Execute a batch file using sql server

I have a bat file which execute the Pentaho kettle job whenever my source update.

so in sql server i create a trigger whenever my source update.
I used this command,

Expand|Select|Wrap|Line Numbers
  1. CREATE TRIGGER dbo.job_trigger 
  2.    ON  dbo.test 
  3.    AFTER INSERT,DELETE,UPDATE
  4. AS 
  5. BEGIN
  6.     -- SET NOCOUNT ON added to prevent extra result sets from
  7.     EXEC master..xp_CMDShell 'C:\testjob.bat';
  8.  
  9.     -- Insert statements for trigger here
  10. END
  11. GO
whenever I insert a new record it goes in infinite loop.


Please help who can I execute the batch file using trigger.
Aug 9 '13 #1
1 6636
Rabbit
12,516 Expert Mod 8TB
Your batch files is probably doing something to cause an infinite loop. It's probably inserting a record into the test table which triggers job_trigger. But that's a guess because you haven't told us what the batch file does.
Aug 9 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Me | last post by:
hi, I have this file I need to execute from an ASP client. since we have installed it on the SQL Database server machine, I thought I could run it like this: Set Cn =...
0
by: Pedro Bautista | last post by:
Status: Unsolved and puzzling Steps to reproduce the error: 1.- Delete IUSER from server 2.- Reboot server (OS rebuilds IUSR) 3.- Assign IUSR read and execute permission on web folder and...
2
by: DB | last post by:
Hi All, I have to execute dos command containing batch file using asp.net application. Code for batch file execution is working properly when I tried it with console application but same code...
3
by: Chris | last post by:
Hi, How can I execute a batch file form asp.net app. I have a form which a user uploads a text file. after the file is uploaded I want a batch file to then execute and do some work. Thanks
0
by: Elroyskimms | last post by:
I need to execute a batch file via ASP.Net. In my VB.Net code, I'm using System.Diagnostics.Process to call the batch file and its appropriate command line arguments. I'm using...
0
by: RadhakrishnanR | last post by:
Can you give the direction to do the following : I want to create batch file from VB6.0 application. In that creating batch file i want to pass the userid, password, FTP server Ip address. i.e...
4
by: Ronald S. Cook | last post by:
Currently (manually), I 1) open a Windows SDK Command Prompt and 2) navigate to a particular folder. Then I 3) type a command and press enter. The command is irrelevant (WCF-related) but here it...
2
by: mayurshah01 | last post by:
Hey guyz, I'm leaning c++. i wanna execute *.exe file using c++ pogramming. For example I have four *.exe files, a.exe b.exe c.ece d.exe Now i'll ask user for option that which file he/she...
1
by: Ira Sinha | last post by:
I have created a batch file, which is using 7z command to encrypt and compress a file. The command in the batch file is 7za -TZIP a -p I am able to run the batch file successfully from the...
2
by: huiling25 | last post by:
I tried for several days, but none can work. IE keep showing yellow exclamation mark at the status bar after clicking "Submit" and batch file cannot be executed. The HTML file and batch file is in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.