ExecuteScalar
我想从我的存储过程中选择一个变量,以便在 ADO.net 中使用时可以获得变量值。
我的存储过程是这样的
CREATE PROCEDURE dbo.SPListGetID
(
@category varchar(100)
)
AS
declare @maxListId int
set @maxListId=(select max(MaterialId) from tblMaterialLists
where category =@category and mode='1')
set @maxListId=@maxListId+1;
select @maxListId
/* SET NOCOUNT ON */
RETURN
这里select @maxListId
是不允许的。我应该怎么做才能做到这一点?