SQL : Search text within a variable

Associate
Joined
6 Jan 2006
Posts
1,024
Location
Midlands
In my SQL, i have declared a variable @description. I have set some text to it. How do i search that variable for a word? I have tried the following code.

Code:
Declare @Description varchar(255)
SET @Description = 'pipe text'

if exists (@Description LIKE '%pipe%')
begin
	print @Description
end
 
Back
Top Bottom