You will need to know the data type for each column, and then...
For char/nchar/varchar/nvarchar
Update Table Set Field = IsNull(Field, '')
OR
Update Table Set Field = '' Where Field Is NULL
for numbers
Update table set field = IsNull(Field, 0)
OR
Update table set Field = 0 Where Field Is NULL
Unless you are very familiar with the database, you probably shouldn't do this. Generally, NULL means 'I don't know', so, by setting the value from NULL to blank you will lose information. Specifically, you won't know which fields you don't know the value for compared to those fields with truely blank data.
For example, not everyone has a middle name. If you were storing middle name, and the value is NULL, it should represent that you don't know what the middle name is. If the value is '' it should be that you know waht the middle name is, and it's blank.
-George
Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
Your other option for doing this, and going forward would be to alter the table and have a default for the fields as either '' or 0 based on the datatypes, so that going forward NULLS will be replaced by the server for you.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.