>
So it works like "mark records for deletion" and defers the "pack" until the commit? >
>I've actually been struggling the last two minutes between typing, "well, sort of"....and "well, not really" :)
>
>When SQL Server deletes a row (even in a txaction), it's not so much marked - in the txaction log, there are 2 system tables (INSERTED/DELETED), available inside a trigger, to see the state of the row before/after the DML statement (in this case, a DELETE). The txaction manager works in conjunction with a transaction log. (This is probably why newer relational engines, like those in Azure, require each table to have a PK)
>
>I realize you didn't mention FoxPro, but since the concept of "mark records for deletion" and the VFP DELETED() function are obviously part of all our vocabulary - SQL Server doesn't have a SET DELETED OFF or a filter capability on what's DELETED(). So it's a bit of apples and oranges (part of why I struggled years ago in the learning curve to SQL). Some people who move from VFP to SQL wind up creating a DELFLAG column for each table, and prefer to use that, because they're initially more comfortable with the behavior.
>
>I think the more accurate thing to say is that SQL Server has logged the location for the data pages to be de-allocated - and refers to those addresses if a rollback occurs. My understanding is that the disk space is "protected" during that stage, though I don't know if I'd want to rely on that.
Didn't mean to really parallel it with VFP but I was referring to the idea that actuall truncation (which I didn't even know you could do in a transaction as I find programmatic truncation kind of scary anyway as I just haven't found a use case where I thought it was the best thing to do) was deferred in some way - i.e. the table would be treated as truncated within the context of the transaction but that would not be a fact in storage until the transaction was committed.
I just figured it was done by elves, or magic or something. Trying to understand it more deeply than that (when I know guys Iike you I can ask if I really need to know <g> ) just makes my head hurt.
I am spending the day trying to master Angular, Bootstrap, Breeze, underscore, require, WebAPI, EF and mocks and repository patterns.
Tomorrow I will seriously consider developing a drug habit.
Charles Hankey
Though a good deal is too strange to be believed, nothing is too strange to have happened.
- Thomas Hardy
Half the harm that is done in this world is due to people who want to feel important. They don't mean to do harm-- but the harm does not interest them. Or they do not see it, or they justify it because they are absorbed in the endless struggle to think well of themselves.
-- T. S. Eliot
Democracy is two wolves and a sheep voting on what to have for lunch.
Liberty is a well-armed sheep contesting the vote.
- Ben Franklin
Pardon him, Theodotus. He is a barbarian, and thinks that the customs of his tribe and island are the laws of nature.