Why would I get an 'incorrect syntax' error with this (on the OUTPUT keyword):
DELETE tb
FROM dbo.TransactionBatch tb
OUTPUT Deleted.TransactionID INTO #TransactionIDs
INNER JOIN @BatchTransactionIDs tid
ON tb.TransactionID = tid.TransactionID
@BatchTransactionIDs is a User-Defined Table type
Best Answer
The
OUTPUT
has to go before theFROM
.