在MSSQL上跟踪视图和表 [英] Track Views and Tables on MSSQL
问题描述
我在MSSQL中得到一张表,该表几乎每秒都从另一个软件(股票价格)进行更新.
我需要使用显示来自MSSQL的视图的网格来创建WPF应用程序. (视图只是一个复杂的查询,在stock表和其他一些表上具有内部联接).
但是由于View不断更新,所以我无法真正每秒执行一次"SqlDataAdapter.Fill(ds)".
至今;我听说过以下技术..
SQL依赖项
推送订阅与Bindable-LINQ结合
SQL StreamInsight.
SQLstream.com
哪一种是实现此目标的正确方法?
感谢
Hi,
I got a table in MSSQL which keeps updated almost every second from another software (Stock Prices).
I need to create a WPF Application with a grid that shows a View from MSSQL. (view is just a complex query with inner joins on the stock table and some other tables).
But since the View keeps updated, I can''t really do "SqlDataAdapter.Fill(ds)" every second.
So far; I''ve heard about the following techniques..
SQL-Dependency
Push Subscription combined with Bindable-LINQ
SQL StreamInsight.
SQLstream.com
Which one is the proper way to achieve this?
Thanks
推荐答案
使用触发器,将受影响的实体ID写入推送通知队列表
使用SQL Service Broker,将通知从队列表发送到所有最终客户端都连接到的通知服务器.
将一批受影响的entityid的推送通知事件从通知服务器分发到所有连接的客户端
客户端针对视图重新查询受影响的实体,并相应地更新UI(删除任何已删除的对象,更新任何更改的对象,插入任何新的对象)
效果很好.
Using triggers, write the affected entity ids to a push notification queue table
Using SQL service broker, send notifications from the queue table to a notification server to which all end clients are connected
Distribute push notification events for batches of affected entityids from the notification server to all connected clients
The client re-enquires against the view for the affected entities and updates the UI accordingly (remove any deleted, update any changed, insert any new)
It works well.
这篇关于在MSSQL上跟踪视图和表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!