...
Declare @TableRequests Table (RequestId int, MyRowCount Int Identity(1,1))
Declare @i Int, @MaxI Int, @RequestId int
Insert into @TableRequests
Select id
From tblQueueRequest
Where (Status='processing')
--Where (id = 1074456)
Select @MaxI = @@RowCount, @i = 1
While @i <= @MaxI
Begin
Select @RequestId = RequestId from @TableRequests where MyRowCount = @i
exec sp_DelQueueRequest @RequestId
Select
@i = @i + 1, @RequestId = null
End
...
Declare @TableRequests Table (RequestId int, MyRowCount Int Identity(1,1))
Declare @i Int, @MaxI Int, @RequestId int
Insert into @TableRequests
Select id
From tblQueueRequest
Where (Status='processing')
--Where (id = 1074456)
Select @MaxI = @@RowCount, @i = 1
While @i <= @MaxI
Begin
Select @RequestId = RequestId from @TableRequests where MyRowCount = @i
exec sp_DelQueueRequest @RequestId
Select
@i = @i + 1, @RequestId = null
End
...