you will have to work a bit differently.
add a column session (int) to you table; and do like this:
create procedure [dbo].[app_Request]
as
begin
set nocount on
set rowcount 5
update Example set status = 1, session = @@sid
where status = 0 and sid is null
and createdate in ( select top 5 createdate from example where status = 0 order by createdate asc )
select * from Example where status = 1 and session = @@sid
end
Main Topics
Browse All Topics





by: BobLambersonPosted on 2006-08-09 at 21:57:10ID: 17285217
Maybe you want to set up transactions for each transaction?