Solved

sql server 2008  NULLS in Data

Posted on 2014-10-04
3
570 Views
Last Modified: 2014-11-03
HI all,
I'm working on a data migration project and have to transfer data to clients sql server. In my source I have lot of NULL values in some of the columns. what is the best practice. Where ever nulls are in source should I replace them with ''  and then send them the data OR leave nulls as it is as they can query nulls easily than empty fields?
What is the common and best practice. What if they export these nulls to excel. Will it show them nulls too.  Please suggest.
0
Comment
Question by:BI 0824
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 12

Accepted Solution

by:
James Elliott earned 150 total points
ID: 40361962
NULL is the absence of data. I personally would not change that. SQL handles nulls very well.

Here are some functions that do it:

http://www.w3schools.com/sql/sql_null_values.asp
0
 
LVL 65

Assisted Solution

by:Jim Horn
Jim Horn earned 150 total points
ID: 40362170
The topic of NULL vs. '' or 0 or some other character is always a big topic of debate.  Most developers would prefer the NULLs, as there is a big difference between the absense of data (posted above) and a zero, but in some cases based on business need another character is preferred.   Most business people have no frEEaking clue what 'NULL' means, and it only confuses them.

>What if they export these nulls to excel.
Excel often interprets a NULL as the string 'NULL', and write it out when a data set is exported to Excel.  In that case it may be advisable to write a query that replaces the NULL values with '', and export the query.

>What is the common and best practice
Use the ISNULL or COALESCE functions to convert NULLs into some other value.
0
 
LVL 69

Assisted Solution

by:Scott Pletcher
Scott Pletcher earned 200 total points
ID: 40364173
From a purely data perspective, NULLs are extremely valuable in differentiating between unknown/missing data and known data that is actually 0 or blank ('').  From the data side, NULLs are in invaluable advantage that should not be given up.

From the purely development and querying side, NULLs are a royal pita.  Writing queries to properly handle NULLs can be quite tricky, even for those who moderately understand NULLs, but are not really expert at it.  This is particularly true for "not equal" conditions.  For example, if you write " state <> 'FL' " in a query, you might expect to see NULL states, but you won't.

Then what to do?  I suggest that data accuracy/integrity is the most important part of a database.  Therefore, I'd opt to use NULLs and give clear guidelines to developers/power users that write queries on how to properly deal with NULLs.
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question