Solved

Full-text search on multiple tables in a database(MS SQL Server 2000)?

Posted on 2004-08-01
7
373 Views
Last Modified: 2008-02-07
For example, we have 3 tables : Employee, Branch_Office, Designation, and their relationships are as following:
Branch_Oficce
(
   BranchID (PK)
   BranchName
.....
)
Designation
(
   DesignationID (PK)
   DesginationName
.....
)
Employee
(
    EmployeCode (PK)
    BranchID (FK) (reference to Branch_Office PK)
    DesignationCode (FK) (reference to Designaiton PK)
)
Assume we have an employee (for example, EmployeeCode='E0001') works in Branch_Office(BranchID='B001', BranchName='California') and works as Designation(DesginationID='D0001', DesignationName='Administrator').
My problem is that I cannot full-text search an employee base on their BranchName or DesignationName.
It seems that full-text index created on only one table.
Can I full-text search on BranchName or DesignationName of an employee in this situation?
0
Comment
Question by:tinh911
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 11688528
>>It seems that full-text index created on only one table.<<
That is correct.

>>Can I full-text search on BranchName or DesignationName of an employee in this situation?<<
There is nothing to stop you joining these three tables and doing Full Text search on all tables, something like:

Select *
From Employee e
        Inner Join Branch_Office b On e.BanchID = b.BranchID
        Inner Join Designation d on e.DesignationCode = d.DesignationID
Where Contains(Branch_Office.*, 'California')
           Or Contains(Designation.*, 'Administrator')
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 11693588
You can create full-text indexes for more than one table.

Bob
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 500 total points
ID: 11693724
>>You can create full-text indexes for more than one table.<<
Absolutely.  Perhaps I misunderstood the question.

In any case, there is an error in my query, it should read:
Select *
From Employee e
        Inner Join Branch_Office b On e.BanchID = b.BranchID
        Inner Join Designation d on e.DesignationCode = d.DesignationID
Where Contains(b.*, 'California')
           Or Contains(d.*, 'Administrator')
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:tinh911
ID: 11702335
>>It seems that full-text index created on only one table.<<
Sorry for my bad explanation. My idea is that when we create full-text search index in Enterprise Manager, we can only choose ONE table. We can not choose more table in a full-text search index. Maybe I got confused at that time. So, forget my idea. :-).

to acperkins:
Your query:
Select *
From Employee e
        Inner Join Branch_Office b On e.BanchID = b.BranchID
        Inner Join Designation d on e.DesignationCode = d.DesignationID
Where Contains(b.*, 'California')
           Or Contains(d.*, 'Administrator')
 It seems that we have to create full-text search index in both Branch_Office and Designation table. Right?
OK, I'll try it!
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 11703559
I was only trying to say that you can repeat the operation of creating an index for each table that needs full-text searches--not having more than one table in the index.

Bob
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 11704568
>>It seems that we have to create full-text search index in both Branch_Office and Designation table. Right?<<
Yes, that is correct.
0
 

Author Comment

by:tinh911
ID: 11713640
Thank you, all my experts!
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question