Solved

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

Posted on 2004-08-05
12
333 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 

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 100 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 100 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 100 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 200 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

623 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