blanks (”) instead of NULL’s in SQL Server 2000

pts.
Tags:
Database Management Systems
Microsoft .NET
I have a development team that wants to represent all fields with no values with a '' (blank) instead of using the database standard of NULL. The team is coding in C#. I am told it is easier for them to code around blanks than NULL's. Aside from taking up more space in the database than is necessary, what are the drawbacks of this practice? I am concerned with all those blanks messing with the statistics and query plans. There would certainly be more maintenance since each of the blanks would also be stored in the indexes, etc. My other concern is that someone not familiar with this coding practice would be querying the database and not getting the results they require. I haven't seen this as an industry standard. Is this more of a common practice than I am aware of for SQL Server and C#?

Answer Wiki

Thanks. We'll let you know when a new response is added.

Apologies if I am repeating stuff you already know. The database standard is to distinguish ‘NULL’ and blanks – NULL is <Unknown> and a blank represents data that is valid and blank. Access and SQL Server, unlike some database systems, behave themselves in this respect and distinguish between the two. So it would be wrong in principle to change the Null data to blank, since Nulls should never match other Null fields in a search.

For example, you would not want a blood bank to match a sample with Null blood type (not yet entered) to a patient with Null blood type (not yet identified).

However, in practice these are sometimes blurred and if you genuinely want to match both Nulls and blanks, can your team program against a view rather than a table, where the field(s) in question are replaced by calculated fields, e.g. ISNULL(<FieldThatMayBeNull>,””)?

This way the original data remains unchanged and you only combine the Nulls and blanks where appropriate.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Tech Wiz
    I believe that there is a special type for working with Databases, the System.DBNull type.
    If(object == System.DBNull.Value)
        return "value was null";
    
    100 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following