Messages Stopped Appearing In Queue!
Aug 28, 2007
I recently restored my database from a backup and it seems that something in my service broker setup has stopped working, no messages now appear.
I checked that the broker was enabled (it wasnt and i had to use NEW_BROKER because of the 'same id' message)
The database is still set to trustyworthy.
There are also no messages in sys.transmission_queue
I used profiler with all the broker events enabled and the result was as follows:
Broker:Conversation Group
Broker:Conversation STARTED_OUTBOUND
Broker:Conversation CONVERSING
Broker:Message Classify
Broker:Conversation CLOSED
Broker:Conversation Group
Broker:Message Classify
But i'm not sure whether this highlights a problem or not? Any help gratefully appreciated!!
Thanks,
Andy
View 1 Replies
ADVERTISEMENT
Feb 9, 2005
I've set up transactional replication with queued updating. If I stop the queue reader agent through EM, I can't start it again. Agent's history says "Queue Reader aborting. The step failed."
All servers are SQL Server 2000 SP3.
Help is greatly appreciated!
View 1 Replies
View Related
Sep 22, 2005
How to clean all messages of a queue ?
View 5 Replies
View Related
Feb 12, 2007
Hi i am trying to create a batch process then commit for all messages on the queue. The problem i am having is when i run my query (As below) I only receive the first message and the corresponding end dialog for the message although i have 2000 records sitting in the queue. It is my understanding that receive without any criteria i.e top(1) or where clause should select everything of the queue. I tried receive top(100) expecting 100 records but still only got 2 back.
any help appreciated.
WAITFOR(RECEIVE
queuing_order,
conversation_handle,
message_type_name,
message_body
FROM [RMIS_COMMS_Queue]
INTO @tableMessages), TIMEOUT 2000;
View 4 Replies
View Related
Feb 27, 2008
I have a strange problem with messages getting stuck in a transmission queue. The set up is as follows:
1. Client database behind physical firewall
2. Firewall rules forward inbound traffic to Client Database
3. Server database has route to firewall
4. Client and Server databases on different physical networks
Over the last couple of days, the IP address of the PC that has the Client database on it changed. Messages were getting through to the Server from the Client but not the other way round. I presume this also meant that message acknowledgements were also not getting back to the Client because messages were stuck in the Client transmission queue.
Looking in more detail at the queued messages at the Server side, it appeared that the Server had received the messages, processed them, and sent back an end conversation. The state of the conversation in conversation_endpoints was DISCONNECTED OUTBOUND. Which I assume means that these would never get through to the Client?
What is the correct way of dealing with this situation? I tried doing an end conversation with cleanup at the Server end but this is clearly wrong because this removes any trace of the conversation from the Server and means that the messages now get through correclty (again) and processed (again). Meaning that we now have duplicate messages in our database.
Any help would be much appreciated.
Thanks.
View 3 Replies
View Related
Feb 28, 2007
I may have a misunderstanding of how SB works, but this seems like a problem.
If a queue is disable (i.e. status = off) and a message is sent to the queue the message is placed on the sys.transmission_queue. Once the queue is enabled I thought the messages were sent to the queue in the order they were placed on the sys.tranmission_queue? I have been troubleshooting a problem and this is not the case. Do I have a misunderstanding of how the sys.transmission_queue works?
The queue has retention turned off.
View 4 Replies
View Related
Mar 25, 2006
I am little confused with this statement, can please some one clarify!
Create QUEUE ReceiverQueue WITH STATUS = ON,
ACTIVATION ( PROCEDURE_NAME = dbo.process, MAX_QUEUE_READERS = 1, EXECUTE AS 'dbo' )
Does this mean when a message reaches to ReceiverQueue, it will automatically processed by dbo.Process procedure
Create PROC dbo.process As
Begin
DECLARE @conversationHandle UNIQUEIDENTIFIER
DECLARE @message_body varchar(100)
DECLARE @rid int
Begin Transaction;
While (1=1)
Begin
RECEIVE TOP(1)
@rid = Cast(Convert(Nvarchar(max),message_body) as int)
From ReceiverQueue
If (@@RowCount = 0 Or @@ERROR <> 0 ) Break
Exec PriceChange.Extract_AS400Data @rid
End
Commit Transaction;
End
Or do I have to put WAITFOR statement in my stored proc (dbo.Process) to run it continously.
Please guide
Thanks
View 5 Replies
View Related
Dec 15, 2006
I have 2 messages types for a queue and would like to use one application that receives messages of one type from the queue and another application that will receieve messages of a different type from the same queue.
Is that possible and if yes how?
SampK
View 1 Replies
View Related
Jun 4, 2007
Hi,
I am developing automated .Net Unit Tests, and as a prerequisite of each test, I would like to clear the service broker queues of any messages. Executing the
RECEIVE * FROM statement appears to only return a message at a time, and not all as I expected. Any ideas on how to make this happen, besides not having to delete the queues and then having to rebuild them?
Thanks,Eugen
View 3 Replies
View Related
Nov 26, 2007
I have a question about SQL Service Broker.
Here are the steps I use to produce the issue.
1) I drop the Service Broker on the Receiver by running the following sql script:
if exists (select * from sys.services where name = N'//TyMetrix360Audit/DataWriter') drop service [//TyMetrix360Audit/DataWriter]
2) I send some messages using the SQL Service broker on the sender side
3) The messages I send stay in sender transmission queue. Here is an example of what my transmission queue looks like after running select * from sys.transmission_queue on the sender.
02C54400-309C-DC11-8EED-0002B3D9F7B5 //TyMetrix360Audit/DataWriter 386DDD04-7E55-466A-BE83-37EFC20910B9 tcp://SFT3DEVSQL01:4022/TyMetrix360Audit/DataSender //TyMetrix360Audit/Contract 2007-11-26 14:58:10.207 0 //TyMetrix360Audit/Message 0 0 0x3C003F0078006D006C002000760065007200730069006F006E003D00220031002E0030002200200065006E0063006F00640069006E0067003D0022007500740066002D003100360022003F003E000D000A003C0045006E0074006500720070007200690073006500410075006400690074004400610074006100200078006D006C006E0073003A007800730069003D00220068007400740070003A002F002F007700770077002E00770033002E006F00720067002F0032003000300031002F0058004D004C0053006300680065006D0061002D0069006E007300740061006E00630065002200200078006D006C006E0073003A007800730064003D00220068007400740070003A002F002F007700770077002E00770033002E006F00720067002F0032003000300031002F0058004D004C0053006300680065006D00610022003E000D000A00200020003C005400610062006C0065004E0061006D0065003E004E004500540057004F0052004B003C002F005400610062006C0065004E0061006D0065003E000D000A00200020003C005000720069006D0061007200790043006F006C0075006D006E004E0061006D0065003E006E006500740077006F0072006B005F00690064003C002F005000720069006D0061007200790043006F006C0075006D006E004E0061006D0065003E000D000A00200020003C004F007000650072006100740069006F006E003E0055003C002F004F007000650072006100740069006F006E003E000D000A00200020003C004400620055007300650072003E00640062006F003C002F004400620055007300650072003E000D000A00200020003C004400610074006100620061007300650020002F003E000D000A00200020003C0044006100740061003E000D000A0020002000200020003C00780073003A0073006300680065006D0061002000690064003D0022004E006500770044006100740061005300650074002200200078006D006C006E0073003D0022002200200078006D006C006E0073003A00780073003D00220068007400740070003A002F002F007700770077002E00770033002E006F00720067002F0032003000300031002F0058004D004C0053006300680065006D0061002200200078006D006C006E0073003A006D00730064006100740061003D002200750072006E003A0073006300680065006D00610073002D006D006900630072006F0073006F00660074002D0063006F006D003A0078006D006C002D006D007300640061007400610022003E000D000A002000200020002000200020003C00780073003A0065006C0065006D0065006E00740020006E0061006D0065003D0022004E00650077004400610074006100530065007400220020006D00730064006100740061003A004900730044006100740061005300650074003D0022007400720075006500220020006D00730064006100740061003A004D00610069006E0044006100740061005400610062006C0065003D0022004400610074006100220020006D00730064006100740061003A00550073006500430075007200720065006E0074004C006F00630061006C0065003D002200740072007500650022003E000D000A00200020002000200020002000200020003C00780073003A0063006F006D0070006C006500780054007900700065003E000D000A0020002000200020002000200020002000200020003C00780073003A00630068006F0069006300650020006D0069006E004F00630063007500720073003D0022003000220020006D00610078004F00630063007500720073003D00220075006E0062006F0075006E0064006500640022003E000D000A002000200020002000200020002000200020002000200020003C00780073003A0065006C0065006D0065006E00740020006E0061006D0065003D002200440061007400610022003E000D000A00200020002000200020002000200020002000200020002000200020003C00780073003A0063006F006D0070006C006500780054007900700065003E000D000A0020002000200020002000200020002000200020002000200020002000200020003C00780073003A00730065007100750065006E00630065003E000D000A002000200020002000200020002000200020002000200020002000200020002000200020003C00780073003A0065006C0065006D0065006E00740020006E0061006D0065003D0022006E006500740077006F0072006B005F00690064002200200074007900700065003D002200780073003A0069006E007400220020006D0069006E004F00630063007500720073003D0022003000220020002F003E000D000A002000200020002000200020002000200020002000200020002000200020002000200020003C00780073003A0065006C0065006D0065006E00740020006E0061006D0065003D0022006E006500740077006F0072006B005F006E0061006D0065002200200074007900700065003D002200780073003A0073007400720069006E006700220020006D0069006E004F00630063007500720073003D0022003000220020002F003E000D000A0020002000200020002000200020002000200020002000200020002000200020003C002F00780073003A00730065007100750065006E00630065003E000D000A00200020002000200020002000200020002000200020002000200020003C002F00780073003A0063006F006D0070006C006500780054007900700065003E000D000A002000200020002000200020002000200020002000200020003C002F00780073003A0065006C0065006D0065006E0074003E000D000A0020002000200020002000200020002000200020003C002F00780073003A00630068006F006900630065003E000D000A00200020002000200020002000200020003C002F00780073003A0063006F006D0070006C006500780054007900700065003E000D000A002000200020002000200020003C002F00780073003A0065006C0065006D0065006E0074003E000D000A0020002000200020003C002F00780073003A0073006300680065006D0061003E000D000A0020002000200020003C006400690066006600670072003A0064006900660066006700720061006D00200078006D006C006E0073003A006D00730064006100740061003D002200750072006E003A0073006300680065006D00610073002D006D006900630072006F0073006F00660074002D0063006F006D003A0078006D006C002D006D00730064006100740061002200200078006D006C006E0073003A006400690066006600670072003D002200750072006E003A0073006300680065006D00610073002D006D006900630072006F0073006F00660074002D0063006F006D003A0078006D006C002D0064006900660066006700720061006D002D007600310022003E000D000A002000200020002000200020003C0044006F00630075006D0065006E00740045006C0065006D0065006E0074003E000D000A00200020002000200020002000200020003C00440061007400610020006400690066006600670072003A00690064003D00220044006100740061003100220020006D00730064006100740061003A0072006F0077004F0072006400650072003D002200300022003E000D000A0020002000200020002000200020002000200020003C006E006500740077006F0072006B005F00690064003E0031003C002F006E006500740077006F0072006B005F00690064003E000D000A0020002000200020002000200020002000200020003C006E006500740077006F0072006B005F006E0061006D0065003E00780066006400660064006600640066003C002F006E006500740077006F0072006B005F006E0061006D0065003E000D000A00200020002000200020002000200020003C002F0044006100740061003E000D000A002000200020002000200020003C002F0044006F00630075006D0065006E00740045006C0065006D0065006E0074003E000D000A0020002000200020003C002F006400690066006600670072003A0064006900660066006700720061006D003E000D000A00200020003C002F0044006100740061003E000D000A00200020003C004F007000650072006100740069006F006E00540069006D0065003E0032003000300037002D00310031002D00320036005400310034003A00350038003A00310030002E0030003900380036003100350035005A003C002F004F007000650072006100740069006F006E00540069006D0065003E000D000A00200020003C0042006C006F00620043006F006C0075006D006E004E0061006D006500730020002F003E000D000A00200020003C0042006C006F00620047005500490044003E00630061006200610037006500660039002D0066003500650065002D0034006200370035002D0061006400360030002D003000390063003500330038003500640031003100310031003C002F0042006C006F00620047005500490044003E000D000A003C002F0045006E00740065007200700072006900730065004100750064006900740044006100740061003E00 Service Broker received an error message on this conversation. Service Broker will not transmit the message; it will be held until the application ends the conversation.
F620FA2D-309C-DC11-8EED-0002B3D9F7B5 //TyMetrix360Audit/DataWriter 386DDD04-7E55-466A-BE83-37EFC20910B9 tcp://SFT3DEVSQL01:4022/TyMetrix360Audit/DataSender //TyMetrix360Audit/Contract 2007-11-26 14:59:26.813 0 //TyMetrix360Audit/Message 0 0 0x3C003F0078006D006C002000760065007200730069006F006E003D00220031002E0030002200200065006E0063006F00640069006E0067003D0022007500740066002D003100360022003F003E000D000A003C0045006E0074006500720070007200690073006500410075006400690074004400610074006100200078006D006C006E0073003A007800730069003D00220068007400740070003A002F002F007700770077002E00770033002E006F00720067002F0032003000300031002F0058004D004C0053006300680065006D0061002D0069006E007300740061006E00630065002200200078006D006C006E0073003A007800730064003D00220068007400740070003A002F002F007700770077002E00770033002E006F00720067002F0032003000300031002F0058004D004C0053006300680065006D00610022003E000D000A00200020003C005400610062006C0065004E0061006D0065003E004E004500540057004F0052004B003C002F005400610062006C0065004E0061006D0065003E000D000A00200020003C005000720069006D0061007200790043006F006C0075006D006E004E0061006D0065003E006E006500740077006F0072006B005F00690064003C002F005000720069006D0061007200790043006F006C0075006D006E004E0061006D0065003E000D000A00200020003C004F007000650072006100740069006F006E003E0055003C002F004F007000650072006100740069006F006E003E000D000A00200020003C004400620055007300650072003E00640062006F003C002F004400620055007300650072003E000D000A00200020003C004400610074006100620061007300650020002F003E000D000A00200020003C0044006100740061003E000D000A0020002000200020003C00780073003A0073006300680065006D0061002000690064003D0022004E006500770044006100740061005300650074002200200078006D006C006E0073003D0022002200200078006D006C006E0073003A00780073003D00220068007400740070003A002F002F007700770077002E00770033002E006F00720067002F0032003000300031002F0058004D004C0053006300680065006D0061002200200078006D006C006E0073003A006D00730064006100740061003D002200750072006E003A0073006300680065006D00610073002D006D006900630072006F0073006F00660074002D0063006F006D003A0078006D006C002D006D007300640061007400610022003E000D000A002000200020002000200020003C00780073003A0065006C0065006D0065006E00740020006E0061006D0065003D0022004E00650077004400610074006100530065007400220020006D00730064006100740061003A004900730044006100740061005300650074003D0022007400720075006500220020006D00730064006100740061003A004D00610069006E0044006100740061005400610062006C0065003D0022004400610074006100220020006D00730064006100740061003A00550073006500430075007200720065006E0074004C006F00630061006C0065003D002200740072007500650022003E000D000A00200020002000200020002000200020003C00780073003A0063006F006D0070006C006500780054007900700065003E000D000A0020002000200020002000200020002000200020003C00780073003A00630068006F0069006300650020006D0069006E004F00630063007500720073003D0022003000220020006D00610078004F00630063007500720073003D00220075006E0062006F0075006E0064006500640022003E000D000A002000200020002000200020002000200020002000200020003C00780073003A0065006C0065006D0065006E00740020006E0061006D0065003D002200440061007400610022003E000D000A00200020002000200020002000200020002000200020002000200020003C00780073003A0063006F006D0070006C006500780054007900700065003E000D000A0020002000200020002000200020002000200020002000200020002000200020003C00780073003A00730065007100750065006E00630065003E000D000A002000200020002000200020002000200020002000200020002000200020002000200020003C00780073003A0065006C0065006D0065006E00740020006E0061006D0065003D0022006E006500740077006F0072006B005F00690064002200200074007900700065003D002200780073003A0069006E007400220020006D0069006E004F00630063007500720073003D0022003000220020002F003E000D000A002000200020002000200020002000200020002000200020002000200020002000200020003C00780073003A0065006C0065006D0065006E00740020006E0061006D0065003D0022006E006500740077006F0072006B005F006E0061006D0065002200200074007900700065003D002200780073003A0073007400720069006E006700220020006D0069006E004F00630063007500720073003D0022003000220020002F003E000D000A0020002000200020002000200020002000200020002000200020002000200020003C002F00780073003A00730065007100750065006E00630065003E000D000A00200020002000200020002000200020002000200020002000200020003C002F00780073003A0063006F006D0070006C006500780054007900700065003E000D000A002000200020002000200020002000200020002000200020003C002F00780073003A0065006C0065006D0065006E0074003E000D000A0020002000200020002000200020002000200020003C002F00780073003A00630068006F006900630065003E000D000A00200020002000200020002000200020003C002F00780073003A0063006F006D0070006C006500780054007900700065003E000D000A002000200020002000200020003C002F00780073003A0065006C0065006D0065006E0074003E000D000A0020002000200020003C002F00780073003A0073006300680065006D0061003E000D000A0020002000200020003C006400690066006600670072003A0064006900660066006700720061006D00200078006D006C006E0073003A006D00730064006100740061003D002200750072006E003A0073006300680065006D00610073002D006D006900630072006F0073006F00660074002D0063006F006D003A0078006D006C002D006D00730064006100740061002200200078006D006C006E0073003A006400690066006600670072003D002200750072006E003A0073006300680065006D00610073002D006D006900630072006F0073006F00660074002D0063006F006D003A0078006D006C002D0064006900660066006700720061006D002D007600310022003E000D000A002000200020002000200020003C0044006F00630075006D0065006E00740045006C0065006D0065006E0074003E000D000A00200020002000200020002000200020003C00440061007400610020006400690066006600670072003A00690064003D00220044006100740061003100220020006D00730064006100740061003A0072006F0077004F0072006400650072003D002200300022003E000D000A0020002000200020002000200020002000200020003C006E006500740077006F0072006B005F00690064003E0031003C002F006E006500740077006F0072006B005F00690064003E000D000A0020002000200020002000200020002000200020003C006E006500740077006F0072006B005F006E0061006D0065003E00780066006400660064006600640066003C002F006E006500740077006F0072006B005F006E0061006D0065003E000D000A00200020002000200020002000200020003C002F0044006100740061003E000D000A002000200020002000200020003C002F0044006F00630075006D0065006E00740045006C0065006D0065006E0074003E000D000A0020002000200020003C002F006400690066006600670072003A0064006900660066006700720061006D003E000D000A00200020003C002F0044006100740061003E000D000A00200020003C004F007000650072006100740069006F006E00540069006D0065003E0032003000300037002D00310031002D00320036005400310034003A00350039003A00320036002E0037003800340036003400330031005A003C002F004F007000650072006100740069006F006E00540069006D0065003E000D000A00200020003C0042006C006F00620043006F006C0075006D006E004E0061006D006500730020002F003E000D000A00200020003C0042006C006F00620047005500490044003E00350034006300380036006200330036002D0061006300330066002D0034006600300034002D0062006600660066002D003400310062003800310065003500360035006500360066003C002F0042006C006F00620047005500490044003E000D000A003C002F0045006E00740065007200700072006900730065004100750064006900740044006100740061003E00 Service Broker received an error message on this conversation. Service Broker will not transmit the message; it will be held until the application ends the conversation.
The main point is that the sys.transmission queue retains the messages with the error 'Service Broker will not transmit the message; it will be held until the application ends the conversation.'
4. I execute the following sql statment on the sender:
select * from sys.conversation_endpoints
and see that the conversation that sent the messages are in state 'ER'
5. I then recreate the receiver with the following script:
create service [//TyMetrix360Audit/DataWriter] authorization dbo on queue dbo.TyMetrix360AuditQueue([//TyMetrix360Audit/Contract])
6. I send some more messages and see that the new messages are being received and processed correctly.
7. But what of the messages stuck in the sender transmission queue. How are these messages to be resent? Since the conversations are in state 'ER' it seems they are not being resent. Do I need to write a custom SQL script to resend them? I do not want to end the conversation because the message will be lost and not resent.
So, in conclusion, the main question is:
When the receiver goes down, or the receiver service broker simply does not exist and messages pile up the sender transmission queue like in my example how do these messages get resent when the receiver is restored?
By the way when I run
select service_broker_guid from sys.databases where database_id = db_id()
I get the same GUID after the server is restored.
Thanks
View 5 Replies
View Related
Nov 26, 2007
Here is a description:
1. drop receiver side service broker with sql command : drop service [//TyMetrix360Audit/DataWriter]
2. send a message from the sender.
3. now the sys.transmission_queue on the sender keeps the message.
The relevant tables on the sender and receiver no look like this:
the following summarizes the transmission queue on the SENDER:
conversation handle message_body transmission status
5A0F1D1F-449C-DC11-8EED-0002B3D9F7B5 my message in binary, ie 0x.F4E1.... <blank>
the following summarizes the sys.conversation_endpoints on the SENDER:
conversation handle conversation_id state
5A0F1D1F-449C-DC11-8EED-0002B3D9F7B5 461891C8-5D53-4D89-A7C6-097FE2EDB22A CO
the following summarizes the transmission queue on the RECEIVER:
conversation handle message_body transmission status
5A0F1D1F-449C-DC11-8EED-0002B3D9F7B5 message body of error message...... One or more messages could not be delivered to the local service targeted by this dialog.
the following summarizes the sys.conversation_endpoints on the RECEIVER:
conversation handle conversation_id state
5A0F1D1F-449C-DC11-8EED-0002B3D9F7B5 461891C8-5D53-4D89-A7C6-097FE2EDB22A DO
What do I do now?
There is a message stuck in the sender transmission queue. You responded in my last post that I need to do a RECIEVE on the sender and end the conversation myself? This is not helping me. I am still confused about the answer to this. Can you provide some sort of code outline or steps to resolve this issue. As of now I do not know how to resend my messages stuck in the sender transmission queue and they can not be lost when the conversation is ended.
Also, I thought SQL Service broker was supposed to hadle things like this. It is common for the receiver to not be there. In this case the messages should resend automatically once the receiver is back up. Please help as there is no documentation online about how to resolve this issue and your last response was not adequate.
Thanks
View 3 Replies
View Related
Mar 11, 2008
Scenario: (1) Initiator/Target are running on different machines; (2) Target is on SQL Standard Edition with service pack 1; (3) Initiator ends the conversation.
If Initiator is running on SQL Express Edition with service pack 1 or 2, €śSend message€? and €śEnd conversion€? will introduce two messages in initiator€™s sys.transmission_queue. One is empty message with correct message type; the other is empty message with no message type. Both of them are from the Target to the Initiator.
If Initiator is running on SQL Standard Edition with service pack 1, with same stored procedure (attached below), there is no message left in initiator€™s sys.transmission_queue.
We like to find the way to make Initiator on SQL Express Edition acting same as it on SQL Standard Edition, namely not left messages in the initiator€™s sys.transmission_queue
CREATE PROCEDURE [dbo].[CreateMessageForQueue]
@message varchar(max)
AS
BEGIN
SET NOCOUNT ON;
DECLARE @handle UNIQUEIDENTIFIER;
BEGIN DIALOG CONVERSATION @handle
FROM SERVICE [TCP://Initiator:4321]
TO SERVICE N'TCP://Target:4567'
ON CONTRACT LogContract
WITH ENCRYPTION = OFF;
SEND ON CONVERSATION @handle
MESSAGE TYPE LogMessage(@message);
END CONVERSATION @handle
END
Thanks,
View 2 Replies
View Related
Jan 11, 2006
Hello,
This is info that I am still not certain about and I just need to make sure, my gut feeling is correct:
A.
When a procedure is triggered upon reception of a message in a queue, what happens when the procedure fails and rolls back?
1. Message is left on the Queue.
2. is the worker procedure triggered again for the same message by the queue?
3. I am hoping the Queue keeps on triggering workers until it is empty.
My scenario is that my queue reader procedure only reads one message at a time, thus I do not loop to receive many messages.
B.
For my scenario messages are independent and ordering does not matter.
Thus I want to ensure my Queue reader procedures execute simultaneously. Is reading the Top message in one reader somehow blocking the queue for any other reader procedures? I.e. if I have BEGIN TRANSACTION when reading messages of the Queue, is that effectively going prevent many reader procedures working simultaneously. Again, I want to ensure that Service broker is effectively spawning procedures that work simultaneously.
Thank you very much for the time,
Lubomir
View 5 Replies
View Related
Apr 2, 2008
Hello, please help!!
I have spent days searching the web and forums for an answer to this simple question and cannot find an example.
I have built a service broker application on sql server 2005. The application puts some xml on an incoming queue which is basically a few parameters to be used in a query. This queue will then call a stored proc which does some business logic and puts the resulting results in another queue also in xml.
I have written a test harness in SQL to put messages on the inbound queue and then some sql to retrieve the returned code from the outbound queue.
What I want to do is be able to convert the SQL which does this into .net code to be used by an application. i.e. write in .net some code to put xml on a queue and then write some .net code to retrieve xml from another queue.
I wouldn't have thought this would be a difficult thing to do and would have been done hundreds of times, but unable to find anything to simply send and retrieve XML to service broker queues....
thanks for your help.. its really needed. I found some links, but they are really vague and often doing select statments in service broker or something like this. I don't want to call any sql, just send and recieve XML on the queues.
any example code that does this, would be really helpfull
kind regards,
David Weeden
Database Developer
View 2 Replies
View Related
Aug 1, 2007
I have generated a .dsv using named queries.
The dsv consists of 3 tables:
1)CLIENT
2)client_guarantor.
3)client_contacts.
The client_guarantor and client_contacts tables both have a foreign key into the CLIENT table via the column CLIENT.client_id. To give you a visual, the .dsv design view would look something like this:
client_guarantor <- CLIENT -> client_contacts.
I use this .dsv to generate a model and deploy it. My problem arises once I get into report builder. It will not let me build a report that uses columns from all three tables. For instance, if i pull a column from the CLIENT table, then a column from the client_contacts table, and next try to get anything from the client_guarantor table, report builder lets me navigate back to the client_guarantor table (because i have added a column from CLIENT) but wont let me add any columns from client_guarantor to the report.
Am i missing something? I assume that since the CLIENT table can see both the client_guarantor and client_contacts tables, if I add anything from the CLIENT table into my report, I should have access to both other tables located in my model. Am I wrong in this assumption, or do I need to add some flag to my model or something??? Any help or insight is appreciated.
View 1 Replies
View Related
Aug 15, 2007
In the data flow, I have an "OLE DB source" container that calls an SP. The SP does a select statement at the end. If I hit the "Preview" button I'm seeing the results come back, however, when I go to the columns I'm not seeing anything. I don't see the column name. Is there any reason why I don't seem to see this column coming back?
Thanks,
Phil
View 1 Replies
View Related
Mar 17, 2008
Parameters do not appear when I jump to a linked report. What causes the parameters not to appear? I did not make them hidden, so why do they not appear? I can see them when I am within visual studio, but not when the report is published to the web?
View 3 Replies
View Related
Jan 29, 2001
Second post for the day. I've just noticed a few indexes in our tables that have are named like such: hind_c_207_1. They seem to have been put in automatically, and are messing with our index structure. Anyone know where these come from and how I can stop them? Any help would be great.
View 2 Replies
View Related
May 15, 2007
Greetings.I am trying to add some debug to a stored procedure.I put some statements like this throughout the code:select 'some message here';but I never see them.I put them in a test procedure that works fine, so that I have a feeling thatwhen an insert fails in a down-stream try catch block, it messes up thedisplay of the information.Can someone tell me how to best go about outputting debug I can see from astored procedure, or if I am even correct about try catch blocks throwingerrors, messing up the debug visibility.I can post code if necessary. Just a general debug question here.thanksJeff Kish
View 2 Replies
View Related
Jul 20, 2005
Hi,We have a SQL server db backend for our ERP system. I have written aCrystal Report to extract data from one particular table calleditemspecbomw (c.30000 records) which contains amongst other thingsBill of Materials costings. When I run the report I know that somerows are missing as when I look at values through the ERP systemitself, the values are different.What I have found is that when I run the equivalent ERP system report,the Crystal Report I have written shows extra rows. SQL Query Analyserbehaves exactly the same as the report I have written even when usinga "select * from". I have tested opening up a bigger tables (c. 700000records) which appears without a problem. If anyone knows why thismystery is happening, I woould be grateful for your help.Many thanks,Tony.
View 2 Replies
View Related
Dec 5, 2006
Hello,
I am trying make some imports and I am using the wizard.
I have created a new project and added 2 new datasources. One for a DB2 database and one for a SQL Server database
I select Project | SS Import and Export Wizard and the wizard launches.
When I look under datasource I can't find my 2 created datasources. I can create new ones but this is not something I want.
Any help ?
Constantijn Enders
View 3 Replies
View Related
Aug 3, 2007
i have a list which is hidden at the top of my body and then some text boxes afterwards...this should all fit on the first page, but as soon as one of my textboxes has an expression the rest of the data skips to the second page
View 3 Replies
View Related
Aug 3, 2007
I have setup a merge replication publication (SQL server 2005 wth SQL Mobile) with dynamic filters based on host name and when i sync to the pda all data appears fine. When I make changes on the PDA and synchronise, the changes are pushed back to the server fine.
However when I change data on the server and synchronise at the PDA, no changes ever appear!
Surely I must have missed something obvious or done something really stupid.
If i check the replication monitor it just says no changes so any suggestions would be great.
Thanks,
Andy
View 3 Replies
View Related
Aug 14, 2006
Hi all, newbie here (to SQL Server and Visual Studio)...
After a few days of configuring and setting things up, I finally got visual studio 2005 to connect to my sql server 2005 express database. I used server management studio to construct a database with 8 linked tables for my first main application. I plugged in some data and, after setting up proper permissions, was able to get visual studio to connect and return data.
I set up a simple gridview on a page with a sql server connection object to test things out. When I set the connection string to return data from a single table, everything works fine. When I test the connnection within visual studio, I get the results I expect. I build the page and load it up in my browser through the localhost, and I get the expected results.
The problem comes when I try to use a view rather than a table. I build the view in server management studio, and from within visual studio, when I test the connection I get the expected results. However, after building the pages (and rebuilding the site), I get a blank grid in my broswer when I test through localhost. I added another gridview to the page set to a table with a different connection string, and that grid appeared in my browser. I modified that connection string in visual studio to the sql server view, and again, nothing appears in my browser.
I'm not sure if, during all of my tinkering with security and setups I may have inadvertantly shut off the abilty to use views, but I'm not receiving an error messages. I just get a blank page.
Any ideas?Brian
View 1 Replies
View Related
Jul 23, 2005
A couple of databases on one of our SQL Servers is missing in the dbdropdown in query analyzer.Does anyone know what I need to update to sync this with the actualdatabases?Thanks,Burt
View 1 Replies
View Related
Mar 29, 2007
Hi,
I have created an SQL Server instance in SQL Server Management Studio. I have a few databases, and stored procedures in them. When I right click on the stored procedure, I have the menu for "New Stored Procedure, Modify, Script Procedure as, and so on". But, I could not see the "Execute Stored Procedure" item.
Could any one help to find out what could be the problem and solve it?
Thanks,
Luke.
View 1 Replies
View Related
May 11, 2015
I got a script, which ran on SQL Server 7. After compiling on SQL Server 2012, I came across that the previous script used a system ViewsTables columns named "suid", which no longer operate in SQL Server 2012. After modifying the script with 2012 and replaced suid by SID, it works but the suid column is not appearing in System Views. What if we want to get that column back in SQL Server 2012? is there any possible way?
View 3 Replies
View Related
Aug 23, 2006
During an upgrade, we had problems with PK errors on sp_MSget_repl_commands. I recreated the SP with the varbinary characteristic as we have seen in many posts and it was sucessful in starting. However, the sp now appears as a 'user' sp, not a 'system' sp, however I an not sure that is a real issue.
The problem I am seeing is that none of the agents are appearing in replication monitor under their agent folders. Replication appears to be working fine and the publications are showing on the distributor in the Replication Monitor - Publication folder under the appropriate publisher. But all of the agent specific folders (i.e. Snapshot agent, distribution agent, etc) are empty.
Another interesting point, is that if replication fails, the failure 'X' shows up on the Agents folder as well as the publisher, but again, no sign of the agent in the folder.
Thoughts?
View 1 Replies
View Related
Aug 20, 2007
I'm having a heck of a time with named queries. At this point I just want a proof of concept in my DSV. I have a bunch of tables added to the DSV, and I would like to add a named query to it so the user can pick from the name query in report builder. What has to be done to make it appear in the report builder?
View 1 Replies
View Related
Sep 17, 2007
Hi all
I have the following tables:
Code Snippet
CREATE TABLE #Lkp_Circle
(
ID INT ,
Abbreviation varchar(50)
)
GO
CREATE TABLE #Lkp_OtherCircles
(
Circle varchar(50)
)
GO
CREATE TABLE #Tbl_User
(
ID INT,
Name VARCHAR(50),
IsActive bit
)
GO
CREATE TABLE #Tbl_UserDetails
(
AssociateID INT,
CircleID INT
)
GO
INSERT INTO #Lkp_Circle VALUES (1,'C1')
INSERT INTO #Lkp_Circle VALUES (2,'C2')
INSERT INTO #Lkp_Circle VALUES (3,'C3')
INSERT INTO #Lkp_Circle VALUES (4,'C4')
INSERT INTO #Lkp_Circle VALUES (5,'C5')
INSERT INTO #Lkp_Circle VALUES (6,'C6')
INSERT INTO #Lkp_Circle VALUES (7,'C7')
GO
INSERT INTO #Lkp_OtherCircles VALUES ('C3')
INSERT INTO #Lkp_OtherCircles VALUES ('C4')
INSERT INTO #Lkp_OtherCircles VALUES ('C5')
INSERT INTO #Lkp_OtherCircles VALUES ('C6')
GO
INSERT INTO #Tbl_User VALUES ( 101,'U 1','True')
INSERT INTO #Tbl_User VALUES ( 102,'U 2','True')
INSERT INTO #Tbl_User VALUES ( 103,'U 3','True')
INSERT INTO #Tbl_User VALUES ( 104,'U 4','True')
INSERT INTO #Tbl_User VALUES ( 105,'U 5','True')
GO
INSERT INTO #Tbl_UserDetails VALUES(101,3)
INSERT INTO #Tbl_UserDetails VALUES(102,4)
INSERT INTO #Tbl_UserDetails VALUES(103,5)
INSERT INTO #Tbl_UserDetails VALUES(104,5)
INSERT INTO #Tbl_UserDetails VALUES(105,3)
GO
SELECT ISNULL(Circle,'Total') Circle, ISNULL(COUNT([HeadCount]),SUM(1)) AS [Total]
FROM
(
SELECT DISTINCT 'Circle' = CASE
WHEN #Lkp_Circle.Abbreviation IN (SELECT Circle FROM #Lkp_OtherCircles) THEN #Lkp_Circle.Abbreviation
WHEN #Lkp_Circle.Abbreviation NOT IN (SELECT Circle FROM #Lkp_OtherCircles) THEN 'Others'
ELSE 'Total' END,ISNULL(#Tbl_UserDetails.AssociateID,0) AS 'HeadCount'
FROM #Tbl_User INNER JOIN #Tbl_UserDetails ON #Tbl_User.ID = #Tbl_UserDetails.AssociateID INNER JOIN
#Lkp_Circle ON #Tbl_UserDetails.CircleID = #Lkp_Circle.ID
WHERE #Tbl_User.IsActive='True' AND #Tbl_User.ID>0 AND #Tbl_UserDetails.AssociateID>0
) AS PivotTable
GROUP BY Circle
WITH Cube
DROP TABLE #Tbl_User,#Tbl_UserDetails,#Lkp_Circle,#Lkp_OtherCircles
----EXPECTED RESULT
--Circle HeadCount
--C3 2
--C4 1
--C5 2
--C6 0
--Others 0
--Total 5
--
----ACTUAL RESULT
--Circle HeadCount
--C3 2
--C4 1
--C5 2
--Total 5
The criteria for Others is that those circles which are not part of #Lkp_OtherCircles i.e. C1,C2,C3 and C7 clubbed together. I have tried checking for the condition ISNULL when for that circle there is no user but the end result is same. Can someone tell me where I am going wrong and how to correct it?
View 9 Replies
View Related
Dec 1, 2003
Hi All,
I have a stored procedure (works form the SQL side). It is supposed to update a table, however it is not working, please help. What is supposed to happen is I have a delete statement deleting a payment from the payment table. When the delete button is pushed a trigger deletes the payment from the payment table and transfers it to the PaymentDeleted table. The stored procedure is supposed to update the PaymentDeleted table with the empID and reason for deleting, the delete and transfer work fine, however these 2 fields are not updated. Below is the sp and below that is the vb code. Thanks, Karen
ALTER PROCEDURE dbo.PaymentDeletedInfoTrail (@EmpID_WhoDeleted varchar(10), @Reason_Deleted varchar(255), @PmtDeletedID int)
AS
BEGIN
UPDATE dbo.PaymentDeleted
SET EmpID_WhoDeleted = @EmpID_WhoDeleted
WHERE PmtDeletedID = @PmtDeletedID
UPDATE dbo.PaymentDeleted
SET Reason_Deleted = @Reason_Deleted
WHERE PmtDeletedID = @PmtDeletedID
END
Private Sub cmdSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSubmit.Click
Me.Validate()
If Me.IsValid Then
Dim DR As SqlClient.SqlDataReader
Dim strPmtID As String
strPmtID = lblPmtIDDel.Text
Dim MySQL As String
MySQL = "DELETE From Payment WHERE PmtID = '" & strPmtID & "'"
Dim MyCmd As New SqlClient.SqlCommand(MySQL, SqlConnection1)
SqlConnection1.Open()
DR = MyCmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
SqlConnection1.Close()
Dim strDeletePmt As String
strDeletePmt = lblPmtIDDel.Text
Dim cmd As New SqlClient.SqlCommand("PaymentDeletedInfoTrail", SqlConnection1)
cmd.CommandType = CommandType.StoredProcedure
Dim myParam As SqlClient.SqlParameter
myParam = cmd.Parameters.Add(New SqlClient.SqlParameter("@PmtDeletedID", SqlDbType.Int))
myParam.Direction = ParameterDirection.Input
myParam.Value = lblPmtIDDel.Text
myParam = cmd.Parameters.Add(New SqlClient.SqlParameter("@EmpID_WhoDeleted", SqlDbType.VarChar))
myParam.Value = txtEmpIDDelete.Text
myParam = cmd.Parameters.Add(New SqlClient.SqlParameter("@Reason_Deleted", SqlDbType.VarChar))
myParam.Value = txtDeleteComments.Text
SqlConnection1.Open()
cmd.ExecuteNonQuery()
SqlConnection1.Close()
End If
Response.Redirect("PaymentVerification.aspx")
End Sub
View 1 Replies
View Related
Nov 28, 2012
I have an SSAS cube that i want to add some actions to. I've had problems adding a reporting action to the cube so decided just to add a URL action instead. Start simple and build on the concepts...
So i add a new action, give it a name, set the Target Type to Cells, Taget object to All Cells. I've put no condition on the action since i want it to appear all the time.
The action content type is set to URL the action expression is set to [URL] I've also set a caption of "Google" under the additional properties and said that the caption is MDX (I'm aware that it isn't but i do intend to expand on this...).
I then build and deploy my cube, call up excel (2010) and then create a pivot table off the back of the cube but when i right-click the cells in the pivot table and go to "additional actions" it tells me that there are none specified.
[URL]
View 6 Replies
View Related
Jan 29, 2008
I have 4 sets of select queries under 1 stored proc, now on the report calling the stored proc via dataset. when i run the dataset the only first set of the select query related fields appearing under the dataset.
But on the back end sql server, if i execute the same stored proc, i get 4 resultsets in one single executioln.
i am not seeing the remaingin 3 resultsets, on the reports dataset.
Is it possible on the reports or not.
In the asp.net project i was able to use that kind of stored procedures whcih has multiple select statements in 1 procedure., i use to refer 0,1,2,3 tables under a dataset.
Thank you all very much for the information.
View 1 Replies
View Related