HiveBrain v1.2.0
Get Started
← Back to all entries
snippetsqlModerate

How to schedule jobs in Sql server 2008 for less than 10 sec?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
2008sqlthanjobslessforsechowserverschedule

Problem

I want to run a job every 3 seconds, however in SQL Server 2008 we cannot define an interval of less than 10 seconds.

The job is used to insert/update visitor information, and segmentation information into a database which is tracked by google search.

There are up to about 100 rows inserted in a 2 or 3 seconds. That job inserts and update the table in a database. Is there any way to schedule it using sp job scheduling configuration?

Solution

Create a job that is scheduled to start every minute. Have the job do something like:

WHILE 1=1
BEGIN
    EXEC dbo.SomeProcedure; /*  this would be the 
        name of a stored procedure that does the 
        actual work */
    WAITFOR DELAY '00:00:03.000';
END

Code Snippets

WHILE 1=1
BEGIN
    EXEC dbo.SomeProcedure; /*  this would be the 
        name of a stored procedure that does the 
        actual work */
    WAITFOR DELAY '00:00:03.000';
END

Context

StackExchange Database Administrators Q#76802, answer score: 13

Revisions (0)

No revisions yet.