我试图从存储过程返回最后插入行的标识.
我的代码的简化版本如下所示:
CREATE PROCEDURE [sp_name]
@AuthorisationCode uniqueidentifier
AS
INSERT INTO [tablename]
([AuthorisationCode]
)
VALUES
(@AuthorisationCode
)
RETURN @@IDENTITY
GO
Run Code Online (Sandbox Code Playgroud)
我通过Enterprise Library 4.1中的Execute Scalar调用此存储过程.
它返回null.有人看到我做错了什么.
c# sql enterprise-library sql-server-2008 enterprise-library-4.1