473,396 Members | 1,797 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,396 software developers and data experts.

the best way to implement batch job

ck9663
2,878 Expert 2GB
hi guys this is a little challenging, at least for me...here goes...

i have to run a DOS batch file from a server. with some parameters that i need to pass. these parameters can be found on a sql-server table. which means i need to build the string that will be used to call the batch file (set @var = 'callbatch.bat ' + @var1 + ' ' + @var2). then call the batch file using the xp_cmdshell command. each batch file runs about 4-5 hours. i don't have an option. i have to use the batch file. it's an engine call.

here's the trick. once a new file is received i need to run this command. for one file, i might need to run 1 or more batch file. i also need to see if the batch file runs successfully. i am also considering an application that will run even if you close the GUI/Browser.

there are two ways i'm thinking of implementing this:
1. create a "jobs" table. create a trigger on that table that will run those batch file everytime a new record will be inserted. since each batch file runs for 4-5 hours, will the table be locked during the execution of the trigger and will be released only once the trigger is done? is this a good way of implementing this considering the length of time the trigger runs?

2. create a "jobs" table. create a scheduled job that runs every hour to check if there are new record inserted on the table and run the necessary batch files. same question here, since the batch file runs 4-5 hours and the scheduled job runs every hour, will the next scheduled job wait for the preceding one to complete? will this stress my server cpu since it will be running every hour. although the hourly scheduled run will only check if there are new record on the table and will only run the (4-5 hour running) batch file if there are new record?

are there any other option?

thanks so much for the help
Jun 27 '07 #1
4 3645
Purple
404 Expert 256MB
Hi ck9663,

did you sort this out ? What solution did you implement in the end ?

Purple
Aug 29 '07 #2
ck9663
2,878 Expert 2GB
Hi ck9663,

did you sort this out ? What solution did you implement in the end ?

Purple
hi purple, nope i have not implemented this yet. although am thinking of implementing a scheduled job that scans the jobs_table for a newly added job. if i do trigger, the process will stop if the connection is lost. that means i'll have problem if i implement it in a browser-client-server based application
Aug 31 '07 #3
Purple
404 Expert 256MB
Hi ck9663,

I think I would be inclined to approach this the other way around, use windows scheduler to fire an hourly job which looks for the input files and runs an app to pre process and then load into the database. I have no idea how big these files are but I expect you should be able to improve the run time by optimising the insert.

You can then roll back the full file if the processing fails and generate an alert, send someone an email etc..

Is this approach possible ?

Regards Purple
Aug 31 '07 #4
ck9663
2,878 Expert 2GB
Hi ck9663,

I think I would be inclined to approach this the other way around, use windows scheduler to fire an hourly job which looks for the input files and runs an app to pre process and then load into the database. I have no idea how big these files are but I expect you should be able to improve the run time by optimising the insert.

You can then roll back the full file if the processing fails and generate an alert, send someone an email etc..

Is this approach possible ?

Regards Purple
yes, it's possible....and i think my earlier response is a little confusing coz it's the same concept that you're suggesting ;)

the biggest size in row is about 70 columns by 16M rows...the biggest size in columns is about 250 columns by 2M rows...
Aug 31 '07 #5

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

Similar topics

1
by: Anthony | last post by:
Here is a debate we have been having at work about the design of our timeclock database application. We have built an online timeclock system for companies to use to keep track of their employees...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
3
by: Alex | last post by:
Hi all, I'm looking for some advice on how best to implement storage of access logs into a db/2 8.1.4 database running on a RH 7.2 system. I have 5 (squid) web caches running here that...
4
by: Bill | last post by:
I need help closing a CMD window when it is executed from Access. 1) The batch file is called from Access. 2) Access closes, 3) the batch runs a copy of the access database (creating a backup)...
6
by: Charles Neitzel | last post by:
I'm trying to write a windows application in C# (Using Microsoft Visual C# 2005 Express) that is nothing more than a simple UI with buttons on it. The buttons do various things like running...
1
by: Charles | last post by:
I'm trying to write a windows application in C# (Using Microsoft Visual C# 2005 Express) that is nothing more than a simple UI with buttons on it. The buttons do various things like running...
0
by: LynchB | last post by:
Hi there I have an audit table which sequentially logs all activity against a device. A read operation is made up of a batch of (usually) three audit records thusly: Record 1 - Open Record 2 -...
0
by: Steve | last post by:
ASP.net 2.0 SQL 2005 I need to insert/delete multiple records from a database. Error checking and exceptions are not a problem, the data being added/deleted are simple integer IDs. The...
14
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, In my windows applicationm, i need to excute a batch file. this batch file throws some text and questions to the screen, i need to catch the standard Output, check if it's a question, in...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.