我的sql数据库中有一个标量值函数.
将此函数导入Entity Framework模型时收到此错误:
Error 6046: Unable to generate function import return type of the store function 'GetContentByIdAndCul'.
The store function will be ignored and the function import will not be generated. ..\EntityModels.edmx
Run Code Online (Sandbox Code Playgroud)
我的函数tsql是:
ALTER FUNCTION [FRM].[GetContentByIdAndCul]
(@Id int,@Culture nvarchar(5))
RETURNS nvarchar(max)
AS
BEGIN
declare @Result nvarchar(max)
if @Id is not null
set @Result='This Content not defined in this Language'
select @Result=Value from CUL.Contents
WHERE ID=@Id AND (CUL.Contents.Culture = LOWER(@Culture)
OR CUL.Contents.Culture = LOWER(SUBSTRING(@Culture,1,2)))
return @Result
END
Run Code Online (Sandbox Code Playgroud)