This is a dumb question. I was wondering how sql server works in this situation. Lets say I am selecting from a table ( select * from tab) and the table is having hundreds of rows getting inserted per second, how does sql server know when to stop reading the rows?
Edit: Just to add, I did a select on a 200Gb table and monitored the locks on another session with sp_lock and saw that sql server was grabbing page shared lock on one page at a time and reading data. So wondering how does it know when to stop? Does sql server take into consideration when the select started and select only the pages that are committed when the transaction starts?