I am using Full Text Search with LINQ in my application and as this is not supported by LINQ I use a table-valued function workaround. The function is created on SQL Server 2008.

Surprisingly, I get error “The full-text query parameter for Fulltext Query String is not valid” when I search for a simply text e.g. “manager”

I used SQL Server Profiler and found out that LINQ generated the parameter as nvarchar(4000) instead of nvarchar(250) which is in my function.

The biggest surprise came when I changed my SQL Server function so it accepts parameter as nvarchar(4000) instead of nvarchar(250) and the problem is solved.

I was also playing to change the parameter to nvarchar(2000) and less but this also didn’t work.

Does anybody know why this behaves this way?

Updated on 18th November 2013 - Good news and bad news

Good news - I am now using Entity Framework 6 for this particular example and it is not anymore needed to use nvarchar(4000)

Bad news - You have to use instead nvarchar(max) :-(

Edit
Report