Groups | Blog | Home
all groups > sql server (alternate) > november 2004 >

sql server (alternate) : doubt


senthilkumar kalimuthu via SQLMonster.com
11/6/2004 4:52:03 AM
hi,

How to search a word in the sqltable?.ie suppose the field name has data type nvarchar(200). From there i enter the persional address of that persion. now i want to know the information whoes are coming from particular city?. The city value can enter in the address field. how we can make search?...

with regards,
ks.kumar

*****************************************
* This message was posted via http://www.sqlmonster.com
*
* Report spam or abuse by clicking the following URL:
* http://www.sqlmonster.com/Uwe/Abuse.aspx?aid=e6c84061c9cd45279753175428d29c27
David Portas
11/6/2004 9:41:57 AM
You can use LIKE:

.... WHERE col LIKE '%London%'

but this type of search is costly.

If you need to do this type of search then I suggest you separate the
address with a different column for each element: building, street, city,
state/region, postal code, country, etc. This is much easier and more
efficient to search.

--
David Portas
SQL Server MVP
--

AddThis Social Bookmark Button