Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Query - check for a string in stored procedure

0 views
Skip to first unread message

June Moore

unread,
Mar 4, 2005, 12:36:13 AM3/4/05
to
Hi,

I would like to check if a string value exist in a string in sql
server stored procedure, e.g.

set @testString = 'this is my test document.'
if (@testString contains 'test')
begin
.....
end

How do I do this in sql server stored procedure?

Thanks,
June...

Madhivanan

unread,
Mar 4, 2005, 1:51:43 AM3/4/05
to

try this

Declare @testString varchar(100)


set @testString = 'this is my test document.'

if charindex('test',@testString)>0

begin
.....
end

Madhivanan

0 new messages