Hi Team,
I have to Select and Update top 10 rows from a table at the same time using stored procedure.
Thanks
Sushil

Sample Table Query
Create table TestTable (Id int, Payload nvarchar(25),ReqStatus nvarchar(25))
Stored Procedure
ALTER PROCEDURE [dbo].[TestProce]
AS
BEGIN
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
DECLARE @id int;
SET @id = (select top(1) Id from TestTable where ReqStatus = 'Pending' order by 1 asc);
Select * from [FrameworkStagingDatabase].[dbo].[TestTable]
where Id = @id
update [FrameworkStagingDatabase].[dbo].[TestTable] set [ReqStatus] = 'InProgress' where Id = @id;
END
I have the below stored Procedure, where My unique key is Id.
My SP only works for 1 row , but I need to fetch and update 10 rows.
Thanks