I have following T-sql which executed daily. I wonder how I want to get some status of this query whether it is running or stuck somewhere. I means at least it told me how many rows or at what timestamp have the query performed.
WHILE 1 = 1 BEGIN
FROM MyviTable where timestamp < getdate() -70
SET @i = @@ROWCOUNT
IF @i = 0 BREAK