0
不能執行此功能,我得到的錯誤:canot執行此T-SQL函數
Must declare the table variable "@Handle".
函數定義:
CREATE FUNCTION [dbo].[FnGetHandle]()
RETURNS INT
AS
BEGIN
DECLARE @Handle AS INT;
DECLARE @strUser AS NCHAR(256);
SET @Handle = 0;
SET @strUser = CURRENT_USER;
INSERT INTO tbl_handle
Output Handle
INTO @Handle (UserName)
VALUES (@strUser);
RETURN @Handle
END
表定義:
tbl_handle definition (Handle int identity, username nvarchar, created date)