SQL Server Performance

about triggers?

Discussion in 'General DBA Questions' started by Druss, Feb 18, 2005.

  1. Druss New Member

    i want to write a dll that watches a trigger (with vb6).
    does it possible?
    dll must watch the trigger, if the trigger executes dll must send "REFRESH" command to the clients.

    how can i do that?

    thanx all ...
  2. mmarovic Active Member

    Trigger can check in cycle version column value in TriggerExecution table. When value is different than previous dll can react the way you want. So you would need to create TriggerExecution table with version colum, insert row you are going to check with value = 0 and to put code incrementing that column value inside the trigger. I hope this is what you were looking for.
  3. Druss New Member

    can u give a small example about trigger, or any link that does triggerexecutuin table with version colum?
  4. mmarovic Active Member

    TriggerExecution is not system table, that is just my proposal to create custom table. What I mean is:

    1. You create table and insert control row

    create table TriggerExecution(version int)
    insert into TriggerExecution values(0)
    2. Then add
    update triggerExecution set version = version + 1
    code inside your trigger.

    3. Inside dll you keep last version value and when it changes you send your refresh request.

    This is custom solution for your problem if I got it right. I didn't want to ask for details about what is this trigger used for. You may have better custom solution by checking the effect of your trigger execution.

Share This Page