February 10, 2009 at 2:53 am
My requirement is "Make the stored procedure to run daily without using any JOBs.
Thanks in advance.
February 10, 2009 at 3:09 am
What is the problem in using a JOB to execute? After all, jobs are meant to there for this type of actions.
Well, other option I know, is to create another procedure & mark it as auto start (by using the procedure sp_procoption). In that procedure, you write an infinite loop and an if clause that checks the time and executes the main procedure.
--Ramesh
February 10, 2009 at 3:09 am
put the stored procedure in an infinite loop?
in the loop, put something like
WAITFOR DELAY '23:59:59' so that it will only run once a day.
😀
February 10, 2009 at 6:13 am
v-makath (2/10/2009)
My requirement is "Make the stored procedure to run daily without using any JOBs.Thanks in advance.
lots of methods
- use jobs
- write a small application and put that in the windows scheduler
- create a window service
etc
kshitij kumar
kshitij@krayknot.com
www.krayknot.com
February 19, 2009 at 1:44 am
I do not know maybe you can create a vbscript to call the sql server proc?
February 19, 2009 at 1:52 am
v-makath (2/10/2009)
My requirement is "Make the stored procedure to run daily without using any JOBs.
Why the restriction against using jobs?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 20, 2009 at 8:00 am
I understand the requirement as I have a similar situation. I.e., we are a SaaS company and we have numerous customer databases that are all the same. So we don't want to create a scheduled job in each database for these sorts of things and have it launched by the SQL Server agent.
Therefore, we have an external process (job) that iterates through each database and runs the appropriate stored procedure. The external "job" is fired by a job scheduler (e.g., Scheduled Task) on a separate machine (i.e., not the SQL Server machine) whose purpose is to run various scheduled jobs. The machine is a client to SQL Server.
The "code" (job) that executes the stored procedure is written in a variety of languages. The simplist being VBScript using ADO with OLD-DB. Sometimes it is a .Net program written in C#. Lately, we are using Windows PowerShell as it is the "official" scripting language for Windows Server 2008. Which BTW, is real nice as it gives you all of .Net within a scripting environment. And PowerShell 2.0 (still in CTP) has a lot of enhancements including Try...Catch.
With this type of environment, the "jobs" can be custom tailored, via the code, as to logging (log files), alerts (Windows Event Logging), etc.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply