Reputation: 148714
I have a simple View
:
Let's select top 5 rows : (the view doesn't have top 5
- it's just for clarity here)
SELECT TOP 5 [CustomerId]
,[EngLastFirst]
,[EngFirstLast]
,[LocalLastFirst]
,[LocalFirstLast]
FROM [WebERP].[dbo].[View_CustomersNames]
Result :
Let's create a Full Text Index (Right click on the view
):
OK. so now we also have a catalog
:
Right click on the catalog
- to see properties :
All the properties are default
:
Let's click rebuild
on the catalog
:
Great
Let's run a simple CONTAINS
query :
SELECT * FROM View_CustomersNames vcn
where CONTAINS( vcn.*, '"aerSwy*"')
As you see from earlier code - the record does exists :
But it returns no results
While like
does return results:
SELECT * FROM View_CustomersNames vcn
where vcn.engLAstFirst LIKE '%aerSwy%'
Question:
Why I'm not getting result for this query ?
SELECT * FROM View_CustomersNames vcn
where CONTAINS( vcn.*, '"aerSwy*"')
NB - I might be missing something which is very basic (new to Full Text Search)
Edit
In production environment - it does work. in my local environment - it doesn't
Upvotes: 4
Views: 96
Reputation: 148714
Found the problem — It was permissions
Here :
And now the CONTAINS
works :
Upvotes: 3
Reputation: 23
You should remove TOP 5 from your view. I don't believe that will work in SQL. Order your results however you need to like Keith said. Here is a link to some basic SQL examples. http://www.w3schools.com/sql/sql_quickref.asp Try using some of these as a reference when reconstructing your statements. These should help guide you on manipulating your sql to do what you need it to. also, I don't think you need to put the name of the database after you reference the table name in your SQL statement.
Upvotes: -1