我用这个存储过程进行插入和返回插入行的id插入后获取ID在SQL Server中
ALTER PROCEDURE [dbo].[addObjective]
(
@Name nvarchar(250)
,@ObjectiveGroupId int
,@CreatorId int
,@LanguageId int
,@isFinal bit
)
as
insert into Objective values
(
@Name
,@ObjectiveGroupId
,@CreatorId
,GETDATE()
,@LanguageId
,@isFinal
)
select scope_identity() as Id;
但如何使用读取使用vb.net
代码
返回的ID此命令将返回-1