Can someone please tell me if insert select from CTE is still an atomic transaction?
Here is my example:
WITH SELECTION AS (
SELECT [Code], [Field1], [Field2]
FROM [Products]
WHERE [Active] = 1 AND Code NOT IN (SELECT [Code] FROM [SomeOtherTable])
)
INSERT INTO JobQueue ([Field1], [Field2], [Code])
SELECT Field1, Field2, Code
FROM SELECTION
Please, do not pay attention on T-SQL logic as it is not an exact example of what I am doing.