We help IT Professionals succeed at work.

updating column data in sql server 2005

blossompark
blossompark used Ask the Experts™
on

Hi,
I have a table with two columns.
I want to update cells in columnB  to contain the same data as columnA when columnB has “Not Available” as its contents
any help appreciated....thanks

BEFORE
columnA      columnB
abc12345      Not Available
abc45672      abc45672

AFTER
columnA      columnB
abc12345      abc12345
abc45672      abc45672
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
UPDATE Table
SET ColumnB = ColumnA WHEN ColumnB = 'Not Available'

Author

Commented:
worked perfectly!! thanks :-)