Watch for a table new records in sql database

前端 未结 6 1331
伪装坚强ぢ
伪装坚强ぢ 2020-12-01 11:36

I am using EF in a windows application and I want my application to do some tasks when a new record inserted in a certain table \"these new records will be inserted by a we

6条回答
  •  天涯浪人
    2020-12-01 12:09

    How about a transaction table where you store the information of the transaction inserted by the website.

    On the insertion table you create a trigger for insert that puts a new record in the transactions table.

    Then you only need your windows app to periodically check the transaction table, when it finds something do what ever you want and then clear the record on the transaction table.

    It is not very elegant, but it may work. I am not familiar with EF and I don't know if it has a better solution for this.

提交回复
热议问题