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 2005 Forums
 Transact-SQL (2005)
 Replacing all NULL values with BLANK values

Author  Topic 

kwirky
Starting Member

8 Posts

Posted - 2010-08-05 : 20:43:09
Is there a query that I can use to replace all NULL values in a table with a blank cell?

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-08-05 : 22:44:35
[code]update yourtable
set yourcol = ''
where yourcol is null[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-08-09 : 05:09:37
quote:
Originally posted by kwirky

Is there a query that I can use to replace all NULL values in a table with a blank cell?


Why do you want to di this?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2010-08-09 : 14:19:21
if you do this update it will take costs as well as space.

rather than updating, i suggest you tweak it in select list with query.

select
isnull(myColumn,'') as MyNotNullColumn
,MyColumn
from MyTable
Go to Top of Page

kwirky
Starting Member

8 Posts

Posted - 2010-08-09 : 17:49:51
Hi,
We have a separate application which takes data from te main db, however when we do a bulk upload from Excel, any fields whicvh do not have values show up as NULL in the corresponding SQL table. The application cannot process any records which have a NULL in a field.
Is there a way to upload from Excel (basically doung a copy and paste) to eliminate the NULL in the first place?

Thanks
Kwirky :)
Go to Top of Page
   

- Advertisement -