March 4, 2012 at 11:27 pm
i have a db table with nvarchar,float and date time fields i was able to convert the date time to nvarchar and use it in full text search but not able to do it with float, even though i was able to convert the float to nvarchar i was not able to use it in full text search. the following error occurs when i try to use it in full text search.
"computed coloum cannot be used for full text search because it is non deterministic or imprecise non persisted computed coloumn"
please help
March 5, 2012 at 1:54 am
Can you post the definition of yuor computed column?
-- Gianluca Sartori
March 5, 2012 at 2:10 am
str(exp1.ProjectSellPrice,25,2) as ProjectSellPrice
i am converting the above field from float to string in my view and creating a full text index to my view, the error occurs when i try to index the above field (ProjectSellPrice).
March 5, 2012 at 2:31 am
In this case, I think you need to add the PERSISTED attribute in order to create the fulltext index.
STR is not a precise function.
SELECT COLUMNPROPERTY(OBJECT_ID('YourTableName'), 'YourColumnName', 'IsDeterministic'),
COLUMNPROPERTY(OBJECT_ID('YourTableName'), 'YourColumnName', 'IsPrecise')
This page on MSDN contains the guidelines for creating indexes on computed columns:
http://msdn.microsoft.com/en-us/library/ms189292.aspx
-- Gianluca Sartori
March 7, 2012 at 7:03 pm
Thanks a lot Sartori,
Even though the soultion given by you did not work out for me may be because i am not using the computed column but the link you provided helped a lot to move in the right direction. the issue was float field cannot be used in full text indexing even after converting it to string. so i changed the field type to decimal and then converted it to string using convert(nvarchar(50),decimal_field) in my view which was used for full text indexing
March 8, 2012 at 12:33 am
Actually, I was not trying to suggest a solution, I was only pointing out that float is not a precise type and cannot be used in indexed computed columns.
Thanks for the feedback.
-- Gianluca Sartori
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply