代码如下
ALTER PROCEDURE [dbo].[getaccount]
@account char(100) output
as
begin tran
select top 5 @account = account from account with(readpast,updlock) where state = '未使用'
update account set state = '已使用' where account = @account
if @@ERROR = 0
commit tran
else rollback tran
求如何解决
------解决思路----------------------
把它插入临时表就可以了