Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace NULL cells in a table for all cells with NULL value

Status
Not open for further replies.

JackBurton07

IS-IT--Management
Oct 17, 2007
75
GB
Hi all,

what is the sql to replace all cells in a table taht contain NULL's?

I want to do this in one query: at present I have to write a query for each column

Thanks

JB :eek:
 
First, replace Null with what?
Second, a well structured table shouldn't have a bunch of empty cells. Are your tables normalized? You might want to post your table structure(field names/column headings). You might want to read this:

Fundamentals of Relational Database Design
 
its a data migration - the migrated fields in the staging db all contain nulls from the import and I want to place a value in the NULL's so that the next stage of the migration isnt affected by them.

 
Not sure if this will work, but maybe something like:

UPDATE MyTable SET Field1 = Nz(Field1,"DefaultValue1"),
Field2 = Nz(Field2, "DefaultValue2")

etc.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top