How to rerun SQL query after delay?

This sample show how to run the same query with delay. It will keep running the same query with 10 second delay and keep re-executing at least 5 times. Good example to when to use this is when you want to check the status on an on going backup.

Select L.NAME DBName,R.percent_complete as [Progress%]
FROM Master.dbo.sysdatabases L Left join sys.dm_exec_requests R on L.DBID=R.Database_ID
WHERE percent_complete > 0
raiserror('',0,1) with nowait
waitfor delay '00:00:10'
GO 15