View to Table - Synchronization

  • You don't, you make it fire from the trigger :

    Create a custom alert, set up a job to start when that alert is triggered.

    Put the code in that job.

    Raise the alert from the trigger.

  • One trick I have found speeds this kind of query is to move most of your Where clause items to the ON expression for that table, so:

    ...

    FROM dbo.procs a

     INNER JOIN dbo.rlvntdata b ON a.procid = b.procid

     INNER JOIN dbo.rlvntdata c ON a.procid = c.procid

    ...

    WHERE (a.parentprocid = 0) AND (b.rlvntdataname = 'ClientName') AND (c.rlvntdataname = 'CompanyName')

    ...

    Becomes:

    ...

    FROM dbo.procs a

     INNER JOIN dbo.rlvntdata b ON a.procid = b.procid

      AND b.rlvntdataname = 'ClientName'

     INNER JOIN dbo.rlvntdata c ON a.procid = c.procid

      AND c.rlvntdataname = 'CompanyName'

    ...

    WHERE a.parentprocid = 0

    ...

    See if this helps any.

    Andy

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

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