Last post Mar 29, 2015 11:14 PM by Edwin Guru Singh
Mar 27, 2015 04:40 AM|sudip_inn|LINK
i have many doubts for queue in sql server. i searched google for queque for beginner like article but got nothing still. so i like to post few question regarding queue.
1) what is queue in sql server and what for people use queue ?
2) i guess people would store data in queue but why because we can store data in table then why people would use queue ?
3) how to create a queue
CREATE QUEUE ExpenseQueue
PROCEDURE_NAME = expense_procedure,
MAX_QUEUE_READERS = 5,
EXECUTE AS 'ExpenseUser' ) ;
the above statement and their option is not clear to me.
4) how to store data in queue ?
5) can queue has many field like table ?
6) can we store a customer details in queue like (custid, Name, phoneno etc) ?
7) when queue data is removed or dequeue ?
8) suppose 10 data is stored in queue then how could i read a data from queue whose custid=5 ?
9) can we explicitly remove one or two data from queue ?
10) discuss the best situation when people would use queue to store/read data from queue instead of table?
11) what is the difference between queue and table ?
please answer point wise in details.
Mar 29, 2015 11:14 PM|Edwin Guru Singh|LINK
As per my search of your case, I have been shared some details below :
Queues store messages. When Service Broker receives a message for a service,
ServiceBroker inserts the message into the queue for that service.
To get messages sent to the service, an application receives messages from the queue.
Service Broker manages queues and presents a view of a queue that is similar to a table
Click here to
get more details about Queue in sqlserver.
here to know more about SQL Server Service Broker
Click here to know more about tables as queue
with its types, limitations & comparison in sqlserver.
here to get the details about insert data into queue in sql server service broker from the similar forum thread.