How to get rid of CURSOR if every FETCH needs a SELECT based on previous result
We have a couple of tables, let’s call them Sections and SectionTimeWindows. Sections table contains data about sections of ‘movement’, which starts at a place, ends at a place and has a type. The type is important, because it determines how much time will a section take – every section type has a set of time windows and the window determines the running time of a section based on when we arrive at the section.
Empty tables specified from a list of table names without using a cursor
I have temporary data that is being uploaded from an external source into empty SQL Server tables. But not always the same tables. I need these tables to be cleared after a MERGE procedure is run.