Home Forums SQL Server 2005 T-SQL (SS2K5) Execute a select statement continually - for instance every 5 minutes RE: Execute a select statement continually - for instance every 5 minutes

  • you can loop it.

    or you could do the agent job on a local instance of sql server(if u have one) and then run the select across a linked server).

    simple example

    DECLARE @i INT = 1;

    WHILE (@i <= 60)

    BEGIN

    WAITFOR DELAY '00:00:01'

    /*Your Script*/

    SET @i = @i + 1;

    END

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events