create proc sp_nextno @preno varchar(14)
as
select incno+1 as intt from nextno where preno = @preno
begin tran tran_nextno
update nextno set incno = incno+1 where preno = @preno
if @@error<>0
begin
rollback tran Tran_nextno
return -1000
end
else
begin
commit tran Tran_nextno
return 0
end
GO
我这样的存储过程可以得到返回值吗?
我想得到select出来的值,用ADOStoredProc怎么写呀????????????
as
select incno+1 as intt from nextno where preno = @preno
begin tran tran_nextno
update nextno set incno = incno+1 where preno = @preno
if @@error<>0
begin
rollback tran Tran_nextno
return -1000
end
else
begin
commit tran Tran_nextno
return 0
end
GO
我这样的存储过程可以得到返回值吗?
我想得到select出来的值,用ADOStoredProc怎么写呀????????????
学习
create proc sp_nextno @preno varchar(14)
as
begin
select incno+1 as intt from nextno where preno = @preno
begin tran tran_nextno
update nextno set incno = incno+1 where preno = @preno
if @@error<>0 goto error_update
commit tran Tran_nextno
return 0
end
error_update:
rollback tran Tran_nextno
return -1000
select得到你要的数据集
result := ADOStoredProc1.Parameters.Parambyname('@newlist_no').value;