Wrox Programmer Forums
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 20th, 2007, 07:05 AM
Authorized User
Join Date: Aug 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to thillaiarasu
Default how to use like operator

hello i am a beginner in sql server.In my project i want to search the persons vi account number or by there name so how should i use the operator like in query

With Regards,

Old April 20th, 2007, 08:25 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post

Did you check Books online(BOL) for its syntax?

- Vijay G
Strive for Perfection
Old April 25th, 2007, 07:57 AM
Registered User
Join Date: Apr 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to manish_partey

you can use like after the where condition

Old April 25th, 2007, 08:53 AM
Friend of Wrox
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc

It is used for search matching or pattern matching
select like, from, what from booksonline
WHERE yourcolumn like '%comparison'

Jaime E. Maccou
Old April 23rd, 2010, 09:47 AM
Friend of Wrox
Join Date: Sep 2009
Posts: 165
Thanks: 5
Thanked 6 Times in 6 Posts

Hello there,
the like statement will match the substring in your database you have specified in your query.
suppose you want to extract data from example table and you have a text control txtBox where you have entered into the account number/ name or any thing you wish and wanna select Id of that selected record then use the following query

select Id from example where Name like '%" & txtBox.Text & "%' "
Hope this helps.
Jack: Founder, Developer & Owner Of JackAndGenieForever.Com

Last edited by jack_hilary; April 23rd, 2010 at 10:02 AM..

Similar Threads
Thread Thread Starter Forum Replies Last Post
having problem with Between operator anantdev SQL Language 1 May 26th, 2008 08:14 AM
=== operator in c# surendraparashar C# 2005 8 November 8th, 2007 05:14 AM
Invalid operator for data type. Operator equals di Pusstiu SQL Server 2000 2 August 10th, 2007 04:51 AM
intersect operator kapy_kal XSLT 1 March 29th, 2006 02:02 PM
Use of return operator. PC BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 3 July 1st, 2005 09:54 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.