New answers tagged

2

My favourite way of achieving this is the OUTPUT clause. Here is an example: SET NOCOUNT ON; -- example setup for the queue table DECLARE @queue TABLE ( transaction_id int PRIMARY KEY, processed bit ); -- some sample data INSERT INTO @queue VALUES (1,0), (2,0), (3,0), (4,0), (5,0); Now the processing thread: -- processing ...


3

The OR REPLACE clause in CREATE FUNCTION is not meant for seamless parallel execution, it's meant to avoid dropping the function when we just want to update the body. From the doc: If you drop and then recreate a function, the new function is not the same entity as the old; you will have to drop existing rules, views, triggers, etc. that refer to the ...



Top 50 recent answers are included