How to send UPDATE trigger to SQL Server Broker

  • Hi

    There's a lot of articles out there on how to get SQL Server broker working, but I could not find one yet that is simple enough to help me implement.

    I currently have a trigger that simply runs an UPDATE statement to a Linked Server. I would like to run the trigger (or just the UPDATE statement) via SQL Server broker in order to improve performance.

    Can someone give me a complete script to do this?

    Current Trigger:

    CREATE TRIGGER MyTrigger

    ON SampleTable

    FOR UPDATE

    AS

    BEGIN

    UPDATE [192.xxx.xxx.xx].Northwind.dbo.Products

    SET ProductName = Inserted.ProductName

    FROM Inserted, Products

    END

    GO

  • Service Broker takes some getting used to, and you really do need to bite the bullet and learn it, otherwise you won't be able to support or troubleshoot your solution, particularly considering you'll be needing to access external/cross-server resources from an activation context.

    It is a difficult subject at first, but one well worth the time and effort in learning, and rolling out. I've found it to be an amazing tool once you get used to it. I'd suggest reading one of Aschenbrenner's books on the topic.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply