.net sukbir

Dear All,

I need to run particular database script every 20 minutes. So what should I be doing I am confuse between windows service and scheduled task. Which is better



Re: Visual C# General Windows Service or Scheduled Task

Gabriel Lozano-Moran

Running it from within the DBMS is not an option




Re: Visual C# General Windows Service or Scheduled Task

.net sukbir

Dear Gabriel,

I dont have that option. So I need to make a separate script will run on 20 minutes intervals. So how can I do that





Re: Visual C# General Windows Service or Scheduled Task

Peter Mourfield

I would say that which is better depends on your scenario. Meaning if you only need to do this on one machine then a scheduled task is probably the right way to go. But, if this is something that needs to be deployed to many differeny machines, then a windows service would be easier.

Hope this helps!





Re: Visual C# General Windows Service or Scheduled Task

.net sukbir

Dear Gabriel,

I guess my choice wil be windos service cause I may later need to run this script on several different machines. Can you tell me where can I get a good reference to start off with my windows service application for my database script.





Re: Visual C# General Windows Service or Scheduled Task

Gabriel Lozano-Moran

Anyway if its only purpose is to run every 20 minutes the first thing I would think off is to use the task scheduler.




Re: Visual C# General Windows Service or Scheduled Task

Gabriel Lozano-Moran

.net sukbir wrote:

Dear Gabriel,

I guess my choice wil be windos service cause I may later need to run this script on several different machines. Can you tell me where can I get a good reference to start off with my windows service application for my database script.

http://msdn2.microsoft.com/en-us/library/zt39148a(VS.80).aspx






Re: Visual C# General Windows Service or Scheduled Task

.net sukbir

Dear Gabriel,

So are you telling me to write a c# script and then put it as task scheduler to run it is it How can I write a database C# script But I guess windows service wil suit me better I guess. Please advice.





Re: Visual C# General Windows Service or Scheduled Task

Gabriel Lozano-Moran

.net sukbir wrote:

Dear Gabriel,

So are you telling me to write a c# script and then put it as task scheduler to run it is it How can I write a database C# script But I guess windows service wil suit me better I guess. Please advice.

I was referring to VBScript (.vbs, .wsf). Just create a ConsoleApplication that does what you need and call that .exe every 20 mins. It is perfectly possible to create a Windows Service for this but if you need to run this on a single machine and you want some kind of User Interface that shows you the progress then you can't use a Windows Service.