testing  and updating column data in sql server 2005 table

blossompark
blossompark used Ask the Experts™
on
I have a table in a sql server 2005 database.

If Column A cell contains ">>" I want the corresponding cell in B to say Yes, else say No

I'm thinking something like;
IF '>>' IN (Column A)
SET Column B = 'Yes'
ELSE
SET Column B = 'No'
 yes

any help appreciated...thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2011
Commented:
Please try the following:

SET ColumnB = CASE WHEN ColumnA LIKE '%>>%' THEN  'Yes' ELSE 'No' END

I hope this helps.

Author

Commented:
Perfect!!  Thank you!! :)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial