[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2004-08-01
7
Medium Priority
?
377 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 2000 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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 

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 Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
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.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

650 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