Fulltext predicate references columns from two different tables or indexed views
SELECT dbo.CustomerMap.DisplayCategoryId, dbo.Customer.CompanyName, dbo.Customer.website, dbo.CustomerMap.Description,
Msg 7646, Level 16, State 1, Procedure sp_readALLCustomerBySearch, Line 11
Fulltext predicate references columns from two different tables or indexed views 'dbo.Customer' and 'dbo.CustomerMap' which is not allowed.
solution for this is use both columns in or condition in highlighted lines
SELECT dbo.CustomerMap.DisplayCategoryId, dbo.Customer.CompanyName, dbo.Customer.website, dbo.CustomerMap.Description,
SELECT dbo.CustomerMap.DisplayCategoryId, dbo.Customer.CompanyName, dbo.Customer.website, dbo.CustomerMap.Description,
dbo.Country.Country, dbo.Customer.phoneNo, dbo.Customer.Mobile, dbo.Customer.FaxNo, dbo.Customer.Address, dbo.Customer.AboutUsUrl,
dbo.Customer.ProductUrl, dbo.Customer.EnqiryUrl,dbo.Customer.email
FROM dbo.CustomerMap
INNER JOIN
dbo.Customer ON dbo.CustomerMap.CustomerId
= dbo.Customer.CustomerCode INNER JOIN
dbo.Country ON dbo.Customer.Country = dbo.Country.Id
where freetext((CompanyName,
Description),@CODE)
gives the following error.
Msg 7646, Level 16, State 1, Procedure sp_readALLCustomerBySearch, Line 11
Fulltext predicate references columns from two different tables or indexed views 'dbo.Customer' and 'dbo.CustomerMap' which is not allowed.
solution for this is use both columns in or condition in highlighted lines
SELECT dbo.CustomerMap.DisplayCategoryId, dbo.Customer.CompanyName, dbo.Customer.website, dbo.CustomerMap.Description,
dbo.Country.Country, dbo.Customer.phoneNo, dbo.Customer.Mobile, dbo.Customer.FaxNo, dbo.Customer.Address, dbo.Customer.AboutUsUrl,
dbo.Customer.ProductUrl, dbo.Customer.EnqiryUrl,dbo.Customer.email
FROM dbo.CustomerMap INNER JOIN
dbo.Customer ON dbo.CustomerMap.CustomerId = dbo.Customer.CustomerCode INNER JOIN
dbo.Country ON dbo.Customer.Country = dbo.Country.Id
where freetext(CompanyName,@CODE) or freetext(Description,@CODE)
Comments
Post a Comment