Sample Header Ad - 728x90

SQL transaction: Delete between two selects possible?

0 votes
1 answer
299 views
I have two SELECT statements within a transaction (repeatable read) Select @firstItem =id from myTable Where .... --Do some more magic, so I can't concat the the two queries!!!! and Select * from myTable where parent=@firstItem Is it possible that the children (second query) of the parent(first query) are deleted (from another transaction) after the initial/first select? How can I prevent this with locks?
Asked by CSharpProblemGenerator (1 rep)
Sep 18, 2019, 09:09 AM
Last activity: May 9, 2025, 04:03 PM