通过Service Broker通知的SqlCacheDependency

编程入门 行业动态 更新时间:2024-10-13 02:21:48
本文介绍了通过Service Broker通知的SqlCacheDependency-仅在特定列上选择敏感的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

是否可以在SELECT上定义一个Notification,但以这种方式:只有在select中写入的列发生更改时,Broker才会重置Cache.因此,列敏感方法.如果表中的一些不重要的列被更改,我不希望缓存重置.我将使用INNER JOIN进行SELECT.

Is it possible to define a Notification on SELECT, but in that way: the Broker would reset Cache only if columns written in select has changed. So Column Sensitive approach. I don't want the cache resets if some unimportant column in the table are changed. I will have a SELECT with INNER JOIN.

预先感谢您的帮助.

推荐答案

理论认为,如果将SELECT列限制为仅包含感兴趣的列,则仅当这些列发生更改时才应通知您.但是了解查询通知的发生时间出现此警告:

The theory goes that if you restrict your SELECT columns to contain only the columns of interest, you should be notified only if those columns changed. However the Understanding When Query Notifications Occur has this warning:

请注意,SQL Server可能会生成查询通知以响应 不会更改数据的事件,或响应于更改的事件 实际上并不会影响查询结果.例如,当 UPDATE语句更改查询返回的行之一, 即使该行的更新未更改 查询结果中的列.

Notice that SQL Server may produce a query notification in response to events that do not change the data, or in response to a change that does not actually affect the results of the query. For example, when an UPDATE statement changes one of the rows returned by the query, the notification may fire even if the update to the row did not change the columns in the query results.

因此,您将得到误报.

更多推荐

通过Service Broker通知的SqlCacheDependency

本文发布于:2023-10-26 18:22:31,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1530976.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:通知   Service   Broker   SqlCacheDependency

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!