By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,760 Members | 955 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,760 IT Pros & Developers. It's quick & easy.

How to schedule the task to execute ASP page

P: 41
I am creating a feature which will allow users to import data of excel sheet to database.

First, data will be imported from excel sheet and will be displayed in a tabular format.

User performs a mapping porcess for database fields and click Submit button.

Then a stored procedure inserts all the data of each row into more than 15 tables.

Above mentioned process might cause an issue if users import more than 1000 records (they are definitely going to do that. Thats why this entire functionality is intended for).

Basically, what I would like to do is, Insert all the rows to a single table (Temp table), have a cloumn in a table which will be a flag and initially, will be set to "Pending".

Create a page which will be executed when there are less users accessing the system (Specific time),

This page will see if there are records in a temp table with FLAG "Pending". If yes then it will fetch one record from the table and will insert data of first row into all the necessary tables. After first transaction it will wait for some time and will fetch the second record....This will last until the final row of temp table is reached.


Sep 1 '10 #1
Share this Question
Share on Google+
3 Replies

P: 201
actually a procedure would be better to handle this type of transaction on your server. so i'll assume your using sql server 2k or windows server; since your using

the first thing i would do is:
1. apply date/time stamp to the inserts on the temp table.
2. you could create a function say activity and the call activity from the procedure insert_temp.

function activity will query all connections. then you can set a value for it to execute when connections is less then 10 users.

you can query connections from the $v_System in oracle or system in sql server. and see who is on and what type of connection. just familiarize your self with those tables.

then have your proc do your executing.

it's less overhead in theory. or you could put your proc on an asp page like you want and see your over head. but to do what you want to do which is data processing. its best to be used from the database, assigned cache, memory, threading, etc...
Sep 1 '10 #2

P: 41
I like your solution, but I have some questions...
Applying date/time stamp means having a column to insert a date in temp table?
If yes, how can I make a use of it.

How can I execute a function automatically/frequently?
Sep 2 '10 #3

P: 201
yes have a column insert date/time. you can use this field to set your procedure to run i.e. qry = select date, from tmp where date <= now() || date = '09/01/2010' so that you can run whats considered a batch job.

because that is your ultimate result is batching the data.

you can also use that for auditing purpose so that you can create a very precise workflow chart when it might be time to do tunning. say for instance one week you have a million records 3 days that week. so that means a total of 3 million records are going to be needed batched. when its low over head ( less users ) .

you can execute this by using transctions. or set it in the scheduler to run a batch.dat which calls your database to log in. so you create a user to access just that proc. then the system will handle the rest because your batch user call the proc() and the proc should execute fine on the other tables. if not then you could add a connect user() clause in the proc so that it executes fine.
Sep 2 '10 #4

Post your reply

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