【发布时间】:2013-02-20 19:12:46
【问题描述】:
如果我在 ADO.net 中使用 ExecuteScalar,我想从我的存储过程中选择一个变量,以便我可以获取变量值。
我的存储过程是这样的
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 是不允许的。我该怎么做才能做到这一点?
【问题讨论】:
标签: asp.net sql sql-server-2008 tsql stored-procedures