You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The full-text query parameter for Fulltext Query String is not valid. #16
Oh, sorry. I revive an error because he parameter is not valid in the sql function. If I copy 'search' and I use it as in my sql example, it is working. I don't know what it happens in CreateFunction
Using full-text query in a TVF requires the variable that comes from EF to be the same size as the variable defined in the TVF.
By default it will create a variable NVARCHAR(4000) meaning your TVF will need to have an input variable of NVARCHAR(4000).
exec sp_executesql N'SELECT
[Extent1].[id] AS [id]
FROM [dbo].[Table] AS [Extent1]
INNER JOIN [dbo].[Search](@Search) AS [Extent2] ON [Extent1].[id] = [Extent2].[Id]',N'@Search nvarchar(4000)',@Search=N'test'
CREATE FUNCTION [dbo].[Search]
(
@Search NVARCHAR(4000) = '""'
)
RETURNS TABLE AS RETURN
(
SELECT a.[KEY] AS Id, ISNULL(a.[RANK], 0) AS [Rank]
FROM FREETEXTTABLE([dbo].[Table], *, @Search, LANGUAGE 0x0) a
)
Full-text query also requires a non blank or a non null value to be passed when called or it will error.
Using full-text query in a TVF requires the variable that comes from EF to be the same size as the variable defined in the TVF.
By default it will create a variable NVARCHAR(4000) meaning your TVF will need to have an input variable of NVARCHAR(4000).
exec sp_executesql N'SELECT
[Extent1].[id] AS [id]
FROM [dbo].[Table] AS [Extent1]
INNER JOIN [dbo].[Search](@Search) AS [Extent2] ON [Extent1].[id] = [Extent2].[Id]',N'@Search nvarchar(4000)',@Search=N'test'
CREATE FUNCTION [dbo].[Search]
(
@Search NVARCHAR(4000) = '""'
)
RETURNS TABLE AS RETURN
(
SELECT a.[KEY] AS Id, ISNULL(a.[RANK], 0) AS [Rank]
FROM FREETEXTTABLE([dbo].[Table], *, @Search, LANGUAGE 0x0) a
)
Full-text query also requires a non blank or a non null value to be passed when called or it will error.
Activity
moozzyk commentedon Jun 24, 2017
You did not describe what problem you are hitting.
erossini commentedon Jun 24, 2017
Oh, sorry. I revive an error because he parameter is not valid in the sql function. If I copy 'search' and I use it as in my sql example, it is working. I don't know what it happens in CreateFunction
moozzyk commentedon Jun 24, 2017
What is the error. Provide all the details including stack trace.
erossini commentedon Jun 25, 2017
Error
The full-text query parameter for Fulltext Query String is not valid.
StackTrace
Function in WordBankContext.cs
ufn_Search in database
moozzyk commentedon Jun 28, 2017
Have you tried tracing what EF is sending to the SqlServer (e.g. using Sql Server Profiler)? This should help figure out what is going on.
Chris3773 commentedon May 12, 2018
Using full-text query in a TVF requires the variable that comes from EF to be the same size as the variable defined in the TVF.
By default it will create a variable NVARCHAR(4000) meaning your TVF will need to have an input variable of NVARCHAR(4000).
Full-text query also requires a non blank or a non null value to be passed when called or it will error.
Ubaid45 commentedon Jul 29, 2021
Worked in my case