There are a cursors, update statement, insert statement.

The update and insert statements are in Loop Cursor Statement.

DECLARE cur1 CURSOR FOR....
OPEN cur1
FETCH cur1 INTO ...

WHILE @@...
BEGIN
SELECT....
UPDATE....
INSERT.....
END


The result are the records query from more than 1 tables. The rowcount can be more than 1000 records.

Thank U