|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Friday, July 27, 2012 2:55 PM
Points: 22,
Visits: 79
|
|
I couldn't get any result too. Anyway, thanks for sharing your exp. Patrick
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, October 25, 2010 3:50 PM
Points: 6,
Visits: 24
|
|
I was not getting any results either in a new database until I ran this script to enable the serice broker in my database: ALTER DATABASE [DatabaseNameHere] SET ENABLE_BROKER from 2005 books online: ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/ac7e4c7c-e52f-4883-8f3c-9336cc77a9c8.htm hope that helps....
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, April 16, 2012 7:08 AM
Points: 3,
Visits: 124
|
|
It is enabled in my database, and still nothing.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, October 25, 2010 3:50 PM
Points: 6,
Visits: 24
|
|
Here are the steps that worked (finally) for me: - Login as 'sa' on your local sql 2005 server.
- Create a new database
- In a new query window, run this script: ALTER DATABASE [DatabaseNameHere] SET ENABLE_BROKER (should return: Command(s) completed successfully.)
- Copy and paste script from 'Intro...to Service Broker' article into a new query window.
- Make sure you're in the newly created database and comment out 'USE AdentureWorks' line at the top.
- Add this snippet (from a previous post) ... WITH ENCRYPTION=OFF, LIFETIME= 600; to the end of line #37. (the section that starts with BEGIN DIALOG @conversationHandle ....ON CONTRACT HelloContract [here])
- Run entire script on your newly created database and it should return the 'Hello world' message.
If not, do a select * from sys.transmission_queue to see what errors were generated. Hope that helps....
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Yesterday @ 3:00 PM
Points: 93,
Visits: 502
|
|
I finally got this to work. How do I get rid of messages in sys.transmission_queue?
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 5:28 AM
Points: 36,
Visits: 206
|
|
Great article, but something went wrong when I ran the sample code - it returns an empty message.
??
BR
Peter Pirker
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, September 29, 2010 12:34 AM
Points: 4,
Visits: 16
|
|
Hi Srinivas...this was an excellent pice of code... can I pls. have your mail id?? I've some further queries to be clarified..my mail ids are : kbagchi@careindia.org & kingshukbagchi@rediffmail.com .
Thnaks is advance,
Kingshuk.
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 7:10 AM
Points: 1,824,
Visits: 3,477
|
|
Here are the steps that worked (finally) for me:
Login as 'sa' on your local sql 2005 server. Create a new database In a new query window, run this script: ALTER DATABASE [DatabaseNameHere] SET ENABLE_BROKER (should return: Command(s) completed successfully.) Copy and paste script from 'Intro...to Service Broker' article into a new query window. Make sure you're in the newly created database and comment out 'USE AdentureWorks' line at the top. Add this snippet (from a previous post) ... WITH ENCRYPTION=OFF, LIFETIME= 600; to the end of line #37. (the section that starts with BEGIN DIALOG @conversationHandle ....ON CONTRACT HelloContract [here]) Run entire script on your newly created database and it should return the 'Hello world' message. If not, do a select * from sys.transmission_queue to see what errors were generated.
Hope that helps....
I ran the following:
ALTER DATABASE AdventureWorks SET ENABLE_BROKER
Then, after running the following, I still get no results:
-- We will use adventure works as the sample database USE AdventureWorks GO -- First, we need to create a message type. Note that our message type is -- very simple and allowed any type of content CREATE MESSAGE TYPE HelloMessage VALIDATION = NONE GO -- Once the message type has been created, we need to create a contract -- that specifies who can send what types of messages CREATE CONTRACT HelloContract (HelloMessage SENT BY INITIATOR) GO -- The communication is between two endpoints. Thus, we need two queues to -- hold messages CREATE QUEUE SenderQueue
CREATE QUEUE ReceiverQueue GO -- Create the required services and bind them to be above created queues CREATE SERVICE Sender ON QUEUE SenderQueue
CREATE SERVICE Receiver ON QUEUE ReceiverQueue (HelloContract) GO -- At this point, we can begin the conversation between the two services by -- sending messages DECLARE @conversationHandle UNIQUEIDENTIFIER DECLARE @message NVARCHAR(100)
BEGIN BEGIN TRANSACTION; BEGIN DIALOG @conversationHandle FROM SERVICE Sender TO SERVICE 'Receiver' ON CONTRACT HelloContract WITH ENCRYPTION=OFF, LIFETIME= 600; -- Send a message on the conversation SET @message = N'Hello, World'; SEND ON CONVERSATION @conversationHandle MESSAGE TYPE HelloMessage (@message) COMMIT TRANSACTION END GO -- Receive a message from the queue RECEIVE CONVERT(NVARCHAR(max), message_body) AS message FROM ReceiverQueue; -- Cleanup DROP SERVICE Sender DROP SERVICE Receiver DROP QUEUE SenderQueue DROP QUEUE ReceiverQueue DROP CONTRACT HelloContract DROP MESSAGE TYPE HelloMessage GO
__________________________________________________________________________________
Turbocharge Your Database Maintenance With Service Broker: Part 1 Real-Time Tracking of Tempdb Utilization Through Reporting Services Monitoring Database Blocking Through SCOM 2007 Custom Rules and Alerts Preparing for the Unthinkable - a Disaster/Recovery Implementation
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 7:10 AM
Points: 1,824,
Visits: 3,477
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, September 29, 2010 12:34 AM
Points: 4,
Visits: 16
|
|
This has actually worked for me... have you done "alter database [database name] set enable_broker"?
Kingshuk
|
|
|
|