service-broker

SqlCacheDependency via Service Broker Notifications - SELECT sensitive ONLY on particular columns

≯℡__Kan透↙ 提交于 2019-12-12 03:43:50
问题 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. Thanks in advance for help. 回答1: 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

Service Broker Queue Custom Reports

帅比萌擦擦* 提交于 2019-12-12 03:14:50
问题 we have started research on Service Broker and planning to implement in application. But we are not getting how to display Statistics reports(in UI) containing: 1. No of messages in the queue. 2. No of Messages so for Executed/Completed. 3. No of messages IN Process, Waiting, Failed,etc 4. No of Conversations in Specific period of time,etc etc etc.... Is there any possible way to fetch these information fully/partially Any help regarding this is highly appreciated. Thanks in Advance. 回答1: Use

SQL Server 2008 table change (insert/update/delete) notification push on broker

南笙酒味 提交于 2019-12-11 18:51:51
问题 I have a rather complex and large database with about 3000+ objects (tables/triggers/sps combined). I inherited this DB and restructuring it is probably 3-4 years away. meanwhile, I need to implement a pub sub feature for any insert/update/delete on these tables. Given number of tables and existing queries probably query notification (and SQL Dependency) will not work. What I am looking for is a way to push the changes (what changed in table - like records PK and table name) on the service

SQL Server Broker Transaction Completed on Poison Message Exception

北慕城南 提交于 2019-12-11 18:08:49
问题 I am using SQL Server Broker in 2008 R2 in a C# application and am trying to handle the case where SQL Server has detected a poison message and has disabled the target queue. When this case occurs, an SqlException is thrown when I'm trying to receive a message. At that point, the SqlTransaction I'm using seems to no longer be committable. I'll use this tutorial to demonstrate along with my C# code. First use the T-SQL code from the tutorial to create the necessary service broker objects and

SQL Service Broker to notify external app

这一生的挚爱 提交于 2019-12-11 12:17:27
问题 After much searching on Service Broker, I came across this question and answer: My scenario is similar to the one mentioned there, in that I have a SQL trigger on a table, and in this trigger I'm calling xp_cmdshell to pass primary key information to an external exe. I can see the value of setting up a Service Broker queue and service instead of using a trigger on a table. As I understand it, the activation sproc that I set up to process messages in the queue would now contain my call to xp

Service Broker: Designing the communication between two SQL servers

若如初见. 提交于 2019-12-11 08:42:50
问题 The goal: Reliable transport of continuously generated records to the central SQL. Summary: The satellite needs to ask the central what are the latest data on its side, and then it is going to send continuously newer ones. The satellite SQL server may be (re)started sometimes (related to physicall production machine), the central SQL machine is likely to run longer, but there also can be some downtime. The lines are mostly reliable, but one never knows... I expect the connection problems be

SQL Service Broker: Collecting data from distributed sources.

我怕爱的太早我们不能终老 提交于 2019-12-11 01:48:37
问题 Summary: I need to collect data reliably from the satelite SQL servers using the SQL Server Service Broker. I need to design the protokol that allows a kind of plug-in another satelite SQL server smoothly. (I am going to refine the question based on your suggestions -- including pictures. But I need to start somehow.) Background: I do have one central SQL server (Microsoft, SQL 2008 R2 Standard ed.) and several small ones near the production machines (the same version, Express edition). The

SQLDependency + Service Broker

╄→尐↘猪︶ㄣ 提交于 2019-12-10 17:55:54
问题 I'm using SqlDependency to get notification when data in some table are changed. private void subscribeBroker() { using (var conn = new SqlConnection(connString)) { conn.Open(); var cmd = new SqlCommand("SELECT text FROM dbo.Test"); cmd.Connection = conn; var dependency = new SqlDependency(cmd); dependency.OnChange += dependency_OnChange; SqlDependency.Start(connString); cmd.ExecuteNonQuery(); } } void dependency_OnChange(object sender, SqlNotificationEventArgs e) { //Do something...

EndDialog Messages stuck in TARGET transmission queue with conversation endpoint in DISCONNECTED_OUTBOUND state

女生的网名这么多〃 提交于 2019-12-08 11:08:59
问题 EndDialog messages are stuck in the TARGET(remote) transmission queue. The transmission_status is blank on each entry. The Initiator is actually receiving the EndDialog message and ending the dialog on it's side. I know that for sure because I have put a PRINT on the INITIATOR service reply queue procedure. The log shows that those procedure are getting executed as a result of the INITIATOR receiving an EndDialog message. Everything works except that in the TARGET, conversation endpoint

How do I get the size of a Service Broker Queue quickly when the table is >500k rows?

吃可爱长大的小学妹 提交于 2019-12-08 10:54:15
问题 I'm trying to determine the total size of a Service Broker Queue and transmission queue when the queue is very large. The problem is traditional querys like the ones below don't work since it's not a table. Any ideas? EXEC sp_spaceused 'sys.transmission_queue' SELECT rows FROM sysindexes WHERE id = OBJECT_ID('ConfigMgrDrsQueue') AND indid < 2 回答1: Remus explains explains how to do it in his blog. Basically you need to query the row count of the underlying b-tree. 来源: https://stackoverflow.com