Generate script for SQL Broker objects I'm using SQL Server Management Studio to generate scripts for all the objects in an existing database:



but the objects related to SQL Broker (messages, queues and services) are not generated.

I've fiddled with the advanced options but still can't get them out.
Is there a way to do it?
Even in Management Studio that ships with SQL Server 2012 (BTW please stop using SSMS 2005 to manage 2008+ instances), the Generate Scripts option will not offer Service Broker objects, whether you select "script all" or select individual objects. You'll need to use other methods - SMO, PowerShell, or right-clicking within the Service Broker node of Object Explorer and scripting items individually. You can speed this up a bit using Object Explorer Details (in the right-hand pane you can select multiple objects and script them), but this is still one operation per object type.

PS this was complained about years ago, but sadly, closed as Won't Fix.


http://connect.microsoft.com/SQLServer/feedback/details/515831/generate-sql-scripts-wizard-missing-object-types


On the plus side, David is right below: SqlPackage.exe will definitely script out service broker objects (it just does it in the wrong order). See my answer to a more recent question here:


How to script all the service broker elements for each database it is on, in the current server?