.NET API for SQL Server Service Broker

Is there a .NET API or object model for using SQL Server Service Broker?

  • Using LastIndexOf and SubString in mssql
  • How to write a query to check if a child has any children in a table
  • Need help writing an SQL join query
  • Generating next sequence number in sql server
  • Handle multiple result from a stored procedure with SqlQuery
  • MS SQL Insert into concat
  • sql server backup not truncating transaction log
  • Connecting SQL Server 2008 to Java: Login failed for user error
  • TransactSQL to run another TransactSQL script
  • How to get running sum of a column in sql server
  • SQL Query Error in Group By and Order By Clause
  • How to avoid sp_OACreate limits?
  • 4 Solutions collect form web for “.NET API for SQL Server Service Broker”

    There isn’t an official supported API. There are some community samples though which are developed by the Service Broker team or related teams in MS which you can use as a starting point, but they are not officially supported (you cannot call product support and report a bug):

    • WCF Transport Channel for SQL Server Service Broker
    • SQL Server Service Broker Product Samples
    • Service Broker Interface (a .Net API for programming SSB, part of the samples linked above)

    Checkout this file: https://github.com/jdaigle/servicebroker.net/blob/893a2d9c6a6ef6aed9c1d05dc6a253183a5d7470/ServiceBrokerDotNet/ServiceBrokerWrapper.cs

    It’s a small wrapper around the T-SQL calls that I wrote. The community samples that other mentioned are more complicated than it needs to be.

    A easy to use queue library for SQL Service Broker based on rhino-queues


    I just found a managed library sample (Readme_HelloWorld_CLR Sample) and a complete T-SQL reference here: SQL Server Service Broker.

    Updated link: http://msftsbprodsamples.codeplex.com/

    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.