1 year ago

#60885

test-img

CompanyDroneFromSector7G

SQL table queue - run procedure on data receipt

I'm optimizing a legacy application and only have access to the database, not the UI code.

There is a specific table insert occurring that I need to catch, so I can do some additional processing, but without adding any obvious lag.

I'm thinking of adding an INSERT trigger which places an entry on a queue, so that processing can continue after returning.

SQL queues using the Service Broker seem to require a 2-way conversation, therefore 2 queues. I don't need this so another possibility could be to use a table as a queue.

But, if I use a table, is there a way for entries to be processed very soon after they arrive, as would be the case with a Service Broker SQL queue? Is the only option to have checks running at a scheduled period? This would be a pain if I need to add more. A trigger on that "Queue" table would also not be a great idea as it would add to performance lag.

Of course I could always just ignore the response queue, but that doesn't feel right.

sql-server

triggers

queue

message-queue

service-broker

0 Answers

Your Answer

Accepted video resources