So, I had a discussion with a co-worker yesterday regarding the application of defaults on columns. Let me give you some background.
We are converting a Foxpro database to SQL Server. The front end is being re-written in .NET. The conversion of the data is such that when a character column is imported that has no data, it comes in as an empty string (''), not a NULL value.
However, when NEW records are added via the .NET front end, it obviously stores them as NULL (if no value is supplied for that column).
This is breaking reports, because it did not don on us to check for NULL values in our queries.
So, the solution my co-worker is recommending is to add a default to all character columns that inserts an empty string. That way we don't have to go back and retro fit a bunch of views and stored procs to add the IS NULL check.
However, my question to the group is the following: Can anyone think of a reason NOT to go this route, such as possible performance degredation?
The correct answer would have been to do NULL checking from the start and we realize that, but we are too far into this to go back and "fix" some things unless we really have to.
Author - Professional SQL Server 2005 XML