0
Answer

Regarding QUEUE in sql server and its real usage

tri_inn

tri_inn

9y
464
1
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
WITH STATUS=ON, ACTIVATION ( 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.