我注意到在SEND语句的文档中它允许一次在多个对话句柄上发送相同的消息。假设在我的情况下,我想发送给定消息的地方数量很少(少于5个),但是我想发送的每条消息都应该发送到所有这些地方。是否有以下任何实际区别:复用Service Broker消息
declare @ch1 uniqueidentifier,
@ch2 uniqueidentifier,
@ch3 uniqueidentifier,
@message xml;
-- approach #1
send on conversation (@ch1, @ch2, @ch3)
message type [foo]
(@message);
-- approach #2
send on conversation (@ch1)
message type [foo]
(@message);
send on conversation (@ch2)
message type [foo]
(@message);
send on conversation (@ch3)
message type [foo]
(@message);
这就是我怀疑的(并将要证实)。我的问题是,我决定在运行时发送哪个句柄(通过数量方式),这意味着要动态地创建发送语句。不可撤销,但也不理想。 –