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)
 simple query

Author  Topic 

harshal_in
Aged Yak Warrior

633 Posts

Posted - 2003-10-01 : 08:01:30
hi,
is there any way to check if there is a specific word in a string?
like i want to check if there is a ',' in 'harshal,mistry'
regards,
harshal.

The Judgement of the Judge is as good as the Judge.

dsdeming

479 Posts

Posted - 2003-10-01 : 08:31:03
CHARINDEX will do what you need.


IF CHARINDEX( ',', 'harshal,mistry' ) > 0
PRINT 'Voila!'

Dennis
Go to Top of Page
   

- Advertisement -