Can SQL CLR triggers do this? Or is there a better way?

后端 未结 6 1749
清歌不尽
清歌不尽 2020-12-19 07:39

I want to write a service (probably in c#) that monitors a database table. When a record is inserted into the table I want the service to grab the newly inserted data, and

6条回答
  •  情深已故
    2020-12-19 08:14

    What you are describing is sometimes called a Job Queue or a Message Queue. There are several threads about using a DBMS table (as well as other techniques) for doing this that you can find by searching.

    I would consider doing anything iike this with a Trigger as being an inappropriate use of a database feature that's easy to get into trouble with anyway. Triggers are best used for low-overhead dbms structural functionality (e.g. fine-grained referential integrity checking) and need to be lightweight and synchronous. It could be done, but probably wouldn't be a good idea.

提交回复
热议问题