Solved

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

Posted on 2004-08-01
7
374 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
Technology Partners: 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

691 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