Stop SQL job if it runs past a certain time
Add
IF convert(varchar(11),CURRENT_TIMESTAMP,108) &gt;= '06:56:59' BREAK;

Before fetching the new row.
This will stop the cursor after 06:56:59
The current timestamp will be converted in a 24h string and will be compared wuth the choosen time every day.