MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old January 26th, 2004, 01:19 PM
Chris_Gilbert Chris_Gilbert is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: London
Posts: 166 Chris_Gilbert User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 2 h 32 m 5 sec
Reputation Power: 5
Searching Fields

How do I search a particular field for a given string?
For instance if I have a productDescription field, that contains a 30 word description of a particular Car for example, how would I search for the word RED or AIR CONDITIONING etc?

Thanks for your help,
__________________
Thanks in advance

Chris

Reply With Quote
  #2  
Old January 26th, 2004, 02:11 PM
madmatt75 madmatt75 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Binghamton, NY
Posts: 22 madmatt75 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Check out the Full Text Indexing engine. There is info in help, better info in the SQL server books available.

In short the process goes something like this:

1. create a primary key on your table.
2. enable full text indexing on the database (sp_fulltext_database @action = 'enable'
3. right click on the table and choose Full Text Index Table -> Define Full Text Index
4. Follow the wizard
5. right click on the catalog and choose Start Full Population

When it's done, your query would be something like this:

select * from PRODUCTS where contains(productDescription ,'car OR Air NEAR Conditioning')

Reply With Quote
  #3  
Old January 26th, 2004, 05:05 PM
Chris_Gilbert Chris_Gilbert is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: London
Posts: 166 Chris_Gilbert User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 2 h 32 m 5 sec
Reputation Power: 5
Is that the only way......?

Is there no way of doing this with ASP and SQL. Its just that I'm currently doing a site that will start off using an access database and then be transformed to a SQL Server one as and when required. It would be much simpler if i could find a way of doing it that could be implemented on both? Access doesn't have a Full Text Indexing Engine does it?

Thanks

Reply With Quote
  #4  
Old January 26th, 2004, 11:24 PM
r937's Avatar
r937 r937 is offline
SQL Consultant
Dev Shed God 24th Plane (16500 - 16999 posts)
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 16,743 r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 3 Weeks 2 Days 21 h 18 m 16 sec
Reputation Power: 870
not to my knowledge, no, Access doesn't have a Full Text Indexing Engine

why not try the simple approach first:
Code:
select model
     , price
     , productDescription 
  from Cars
 where productDescription like '*RED*'
    or productDescription like '*AIR CONDITIONING*'
use asterisks for the wildcard character in Access, use the percent sign in SQL Server

search is case-insensitive in both databases
__________________
r937.com | rudy.ca

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > Searching Fields


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway