Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Replace nulls in all columns

Author  Topic 

araskas
Starting Member

1 Post

Posted - 2004-05-11 : 11:50:03
I have a table that has nulls in all columns. I want to replace every occurrence of null in every column by a 'abc'. How can I run a single update query?

Thanks





supersonic

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2004-05-11 : 11:52:17
UPDATE TABLE
SET Column1 = ISNULL(Column1, 'abc'),
Column2 = ISNULL(Column2, 'abc'),
Column3 = ISNULL(Column3, 'abc'),
Column4 = ISNULL(Column4, 'abc'),
Column5 = ISNULL(Column5, 'abc'),
Column6 = ISNULL(Column6, 'abc')



Duane.
Go to Top of Page
   

- Advertisement -