Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Search string withing field

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-09-08 : 09:05:48
Ramesh Fernando writes "Let me know how do i find string withing the field using sql queries. LIKE is not going to work becouse the string gets changed and could not be define any fixed pattarn. May be contains... but i have no idea how to use it."

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-09-08 : 09:17:14
well contains is used if u have full text catalog enabled.

but so what if the string changes. use the search string as variable and do
declare @KeyWord varchar(1000)
set @KeyWord = '%sometext%'
select * from MyTable where col1 like @KeyWord

Go with the flow & have fun! Else fight the flow
Go to Top of Page
   

- Advertisement -