Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to trigger an asp script once a day that does operations on sql server

Posted on 2004-08-05
12
Medium Priority
?
334 Views
Last Modified: 2006-11-17
Hi,

I have an asp page that I'd like to trigger once a day to run updates on SQL server, what is the most desireable method of doing this. The sql server and asp are hosted on a shared server so I don't have full access to all of iis, etc.

Thanks
0
Comment
Question by:Chris_Granger
[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
12 Comments
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 11729376
Ordinarily this is best done with a pure server-side approach. Otherwise, your page would have to stay open in a browser all of the time....

FtB
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 11729383
So, what would happen in that case is that the page would refresh every so often, and if the time falls in a certain range, it would execute your code. That does sound like quite an awkward way to do things. Wrong tool for the job?

FtB
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 11729392
Now what you could do is to create a page that does all of these things with a link that is not available to your users. You could then use a scheduler on your client machine to invoke the page for you.

FtB
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Chris_Granger
ID: 11729423
Oh no, I didn't mean that. I thought there may be some technique that triggers this sort of thing. It really just mainly running SQL queries. Do you think I should re-open this in the sql server section, I'm sure there's something sql does like that?
0
 
LVL 15

Assisted Solution

by:joeposter649
joeposter649 earned 400 total points
ID: 11729436
Can you try something like this...
http://www.asp101.com/articles/john/schedule/default.asp

"Otherwise, your page would have to stay open in a browser all of the time...."

I'm sure you could do something like this with IE. on your local machine...
http://devguru.com/Technologies/wsh/quickref/wshshell_Run.html
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 11729480
In regard to the first link, that is pretty much what I said above, as for the second that is what I meant by running it from the client side.

@Chris_Granger--

That is a much better approach if it can be done. I am not sure about triggers based on time in SQL Server.

FtB
0
 
LVL 13

Assisted Solution

by:TommyTupa
TommyTupa earned 400 total points
ID: 11729488
I've done this by executing my asp as a vbs file. See here:http://www.aspfaq.com/show.asp?id=2143
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 11729577
@TommyTupa--

But that requires access to the server that Chris_Granger says he doesn't have.

FtB
0
 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 400 total points
ID: 11729597
However, the ASP FAQ article TommyTupa references does indicate that you can schedule jobs within SQL Server:

http://www.aspfaq.com/show.asp?id=2403

FtB
0
 
LVL 6

Expert Comment

by:casstd
ID: 11732253
Hi,

          As TommyTupa said i have done the same thing for receiving one eamil on a day at a particular time.

1. store this file as Query.vbs

<%@ LANGUAGE=VBSCRIPT %>
<!--#include file="ADOVBS.INC"-->
<!--#include file="dbcon.asp"-->
<%


       'Write stored Procedure is the best method and call the stored procedure
        Qry= "sp_Title "                     'your stored procedure name

       or
         Qry = "select * from tbl"
       Set Rs = DbObjmembers.Execute(Qry)
       
          'clear your recordset object
%>

2. Go to server control pannel and look for Shcheduled task and click Add Scheduled Task

3. Thats's all and test whether the qyery is executed or not.

Hope this will helpful to you.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 11732314
>>2. Go to server control pannel and look for Shcheduled task and click Add Scheduled Task<<

The question states:

The sql server and asp are hosted on a shared server so I don't have full access to all of iis, etc

FtB
0
 
LVL 10

Assisted Solution

by:thefritterfatboy
thefritterfatboy earned 800 total points
ID: 11733804
Set up a stored procedure to do what you wish to do daily, then call SQL server's sp_update_jobschedule SPROC to set the interval.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sp_ua-uz_9het.asp

Using a freq_type value of 4 will set the stored procedure to run daily with no access to the SQL server needed in EM.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

664 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