WMI event

  • hi,

    i have 2 table , 1 table has 1 column called processtime ,Once i load data into table1.

    some other tool picks data from table1 , and update processtime to sometime.

    now i am using WMI event watcher to see ,if that tool has updates processtime column,if so i need to pass those records into another table2

    i am not sure what query do i need to put in WMI event watcher so that is see constantly that the column has been updated.

    Is there any other component.how to i do this?

  • WMI (Windows Management Instrumentation) is for querying various properties of Windows state and watching for Windows events. In order to 'watch' a table in SQL Server you do not want the WMI EVent Watcher.

    You will be better off polling the table every so often (whatever is reasonable in your environment) looking for the rows in the table that let you're processing know it is OK to continue processing. You can do this in a Stored Procedure using the WAITFOR DELAY command inside a WHILE loop.

    WHILE 1 = 1

    BEGIN

    IF EXISTS ( SELECT *

    FROM YOUR_TABLE

    WHERE YOUR_COLUMN = 'SOME_VALUE' )

    BEGIN

    -- do work

    -- exit loop

    BREAK;

    END

    ELSE

    BEGIN

    WAITFOR DELAY '00:00:30';

    END

    END

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply