Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • Last Modified:

testing and updating column data in sql server 2005 table

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
0
blossompark
Asked:
blossompark
1 Solution
 
wdosanjosCommented:
Please try the following:

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

I hope this helps.
0
 
blossomparkAuthor Commented:
Perfect!!  Thank you!! :)
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now