Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 484763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:19:59+00:00 2026-05-13T01:19:59+00:00

I have several questions regarding where to handle nulls. Let me set up a

  • 0

I have several questions regarding where to handle nulls. Let me set up a scenario. Imagine I have a table that has 5 varchar(50) columns to use as an example when providing reasons for using nulls or empty strings.

  1. Is it better to handle NULLS in code or in the database? By this I mean, is it better to assign an empty string to a varchar(50) if it contains no value or is it better to assign null to the varchar(50) and handle that null in code?

  2. Does assigning an empty string to a column affect performance overhead?

  3. How does using a null vs. an empty string affect indexing?

  4. I am under the impression that if you do not allow your database to contain nulls, you do not have to handle it in code. Is this statement true?

  5. Do other datatypes besides varchars pose the same problems when using a default value or is it more problematic with string datatypes?

  6. What is the overhead of using the ISNULL function if the table contains nulls?

  7. What are other Advantages/Disadvantages?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T01:19:59+00:00Added an answer on May 13, 2026 at 1:19 am

    My general advice is to declare fields in a database as NOT NULL unless you have a specific need to allow null values as they tend to be very difficult for people new to databases to handle.

    Note that an empty string and a null string field do not necissiarly mean the same thing (unless you define them to). Often null means “unknown” or “not provided”, whereas an empty string is just that, a provided and known empty string.

    Allowing or disallowing null fields depends entirely on your needs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know there have been several questions in the past regarding things that compile
I have several questions regarding filenames and the iPod Library. I understand I can
I have read several questions regarding this but I fear they may be out
I have several questions regarding forms and PHP but if I should put them
I have several questions regarding Python threads. Is a Python thread a Python or
I'm new to Qt Creator and I have several questions regarding multiple build configurations.
I have seen several questions regarding SocketException when using Android, but none of them
I have several questions regarding the Google Map V3 API and its library for
I have been through several SO questions regarding this and my approach is a
I have several questions regarding CI application design. Q. When creating a new form

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.