Entity Framework调用表值函数实现全文检索?

时间:2021-11-01 09:12:43

CREATE FUNCTION [dbo].[udf_BookContentSearch]
(@keywords NVARCHAR(1000))
RETURNS @BookPageDetail TABLE
(
    BookPageDetailID int PRIMARY KEY NOT NULL,
    [RANK] INT NOT NULL
)
AS
BEGIN
 INSERT INTO @BookPageDetail(BookPageDetailID,[RANK])
    SELECT [KEY],[RANK]
 FROM CONTAINSTABLE(CM_BookPageDetail,(Content,Memo),@keywords)
 RETURN
END
GO